Option to run scratch files is unavailable ()
已回答
If I have a scratch file I would like to run, it used to be that I could right click on the file and select the option to run that file or press ctrl-shift-f10 and that would allow me to run it.
Now however that option is not present. (for either the dart file or the java file)


And if I try to manually add a run configuration, it gives an error and does not work.

This is despite the fact that the dart file exists and contains valid dart code including a main function.
Similarly the java scratch file exists and contains a public static void main function.
Why would the option to run dart files not be available?
请先登录再写评论。
The problem with Dart project template missing in the New Project wizard is being fixed. Sorry for the bug. Feel free to vote for the corresponding issue to get notified when it's fixed: https://youtrack.jetbrains.com/issue/WEB-48717.
Workaround is to create an empty project and enable Dart support in it. Or to open an existing Dart project. Dart project template could be created, for example, using Stagehand tool (that's what the IDE is using under the hood when Dart project wizard works as expected): https://pub.dev/packages/stagehand
The problem is not reproduced for my work environment. Please try to remove
disabled_plugins.txtfile from the config directory, restart the IDE, reproduce the problem, and collect diagnostic data. (Help | Collect Logs and Diangostic Data)The files can be uploaded at https://uploads.jetbrains.com. (do not forget to specify the UploadID)
Logs submitted.
Upload id: 2020_12_15_AzTvHnzHhTmPTcn4 (file: idea-logs-20201214-192533.zip)
Does it work if you move the
scratch.dartfile fromScratchesdirectory to the project root one?Yes, it works normally as you would expect when within the project in the root directory, or a sub-directory.
Another thing I have just noticed:
Even though the Dart plugin is enabled,
When I go to create a new project, the dart project template is not available.
I am not sure if this is related or not.
The issue with running scratch files is logged as https://youtrack.jetbrains.com/issue/WEB-48732. Please follow it to be notified on updates.
Great. Thank you.