Sublime Forum

Neither F7 nor Shift+F7 runs a Dart program

#1

In installed the “dart” plugin and followed the instructions to create a project, etc. I wrote a Hello World program, which runs fine if I run it on the command line. But in Sublime Text, I’m supposed to be able to run it by pressing Shift+F7. Instead, I get this:

* Running /Users/barryburd/flutter_commandline_projects/sublime/darttut.dart
* (output starts below the next line)
==============================================================================
[Finished in 0.1s with exit code 255]
[cmd: ['/usr/local/Cellar/dart/2.3.1/libexec/bin/dart', '--checked', '/Users/barryburd/flutter_commandline_projects/sublime/darttut.dart']]
[dir: /Users/barryburd/flutter_commandline_projects/sublime]
[path: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/barryburd/.local/bin:/opt/X11/bin:/Applications/VMware Fusion.app/Contents/Public:/Users/barryburd/eta:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/TeX/texbin:/Applications/Wireshark.app/Contents/MacOS]

How can I diagnose the problem?

0 Likes

#2

The build output is showing that dart actually executed but returned exit code 255. It seems a little weird that it wouldn’t also output some sort of indication of why the error happened, though. Does the interpreter have some sort of --versose type command line option that might make it generate more info, or perhaps something that documents the return codes of the interpreter?

0 Likes

#3

The --verbose option sounds like a good idea. But I don’t know how to turn it on for the Sublime Text Dart plugin.

0 Likes

#4

From the documentation:

Analysis (errors and warnings) is deactivated by default. To activate this feature, open Packages/User/Dart - Plugin Settings.sublime-settings and set the dart_linter_active setting to true

To open this file, you can use the command palette (Ctrl++P), then select Preferences: Settings - User .

I don’t use this plugin so cannot answer any other questions about it.

0 Likes

#5

I added

"dart_linter_active": "true"

to both the Settings - User and the Dart Settings files and restarted Sublime. The output is still the same with no additional messages.

0 Likes

#6

This should be enabled by default but you could check that dart_enable_analysis_server is set to true in the settings. Failing that, you should contact the author of the package. As I mentioned, I don’t use the package, I am only reading the documentation.

0 Likes