Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Darth Analyzer Path issue #39

Open
Narven opened this issue Feb 10, 2022 · 6 comments
Open

Darth Analyzer Path issue #39

Narven opened this issue Feb 10, 2022 · 6 comments

Comments

@Narven
Copy link

Narven commented Feb 10, 2022

I think there is an issue with the Dart Plugin.

When I run i get this error on the extension console:

Dart[8:25:25.020000] Activating...
Dart[8:25:25.020000] Analyzer path is: "/usr/local/bin/cache/dart-sdk/bin/snapshots/analysis_server.dart.snapshot".
Dart[8:25:25.026000] LSP Running
Dart Language Server[8:25:25.109000] Could not find a command named "/usr/local/bin/cache/dart-sdk/bin/snapshots/analysis_server.dart.snapshot".
Dart Language Server[8:25:25.110000] 
Dart Language Server[8:25:25.110000] Usage: dart <command|dart-file> [arguments]
Dart Language Server[8:25:25.110000] 
Dart Language Server[8:25:25.110000] Global options:
Dart Language Server[8:25:25.110000] -h, --help                 Print this usage information.
Dart Language Server[8:25:25.110000] -v, --verbose              Show additional command output.
Dart Language Server[8:25:25.110000]     --version              Print the Dart SDK version.
Dart Language Server[8:25:25.110000]     --enable-analytics     Enable analytics.
Dart Language Server[8:25:25.110000]     --disable-analytics    Disable analytics.
Dart Language Server[8:25:25.110000] 
Dart Language Server[8:25:25.110000] Available commands:
Dart Language Server[8:25:25.110000]   analyze    Analyze Dart code in a directory.
Dart Language Server[8:25:25.110000]   compile    Compile Dart to various formats.
Dart Language Server[8:25:25.110000]   create     Create a new Dart project.
Dart Language Server[8:25:25.110000]   devtools   Open DevTools (optionally connecting to an existing application).
Dart Language Server[8:25:25.110000]   doc        Generate HTML API documentation from Dart documentation comments.
Dart Language Server[8:25:25.110000]   fix        Apply automated fixes to Dart source code.
Dart Language Server[8:25:25.110000]   format     Idiomatically format Dart source code.
Dart Language Server[8:25:25.110000]   migrate    Perform null safety migration on a project.
Dart Language Server[8:25:25.110000]   pub        Work with packages.
Dart Language Server[8:25:25.110000]   run        Run a Dart program.
Dart Language Server[8:25:25.110000]   test       Run tests for a project.
Dart Language Server[8:25:25.110000] 
Dart Language Server[8:25:25.110000] Run "dart help <command>" for more information about a command.
Dart Language Server[8:25:25.110000] See https://dart.dev/tools/dart-tool for detailed documentation.

So I searched to where I have that analyzer.dart.snapshot. and it was on my home directory, cool. When I choose the picker for the path, the PICKER only allows to choose a FILE: but the next errors shows that we path is being prepended to the name of the file, so I get:

Dart[8:25:25.020000] Activating...
Dart[8:25:25.020000] Analyzer path is: /Users/pedroluz/dart-sdk/bin/snapshots/analysis_server.dart.snapshot/analysis_server.dart.snapshot
Dart[8:25:25.026000] LSP Running
Dart Language Server[8:25:25.109000] Could not find a command named "/Users/pedroluz/dart-sdk/bin/snapshots/analysis_server.dart.snapshot/analysis_server.dart.snapshot".
Dart Language Server[8:25:25.110000] 
Dart Language Server[8:25:25.110000] Usage: dart <command|dart-file> [arguments]
Dart Language Server[8:25:25.110000] 
Dart Language Server[8:25:25.110000] Global options:
Dart Language Server[8:25:25.110000] -h, --help                 Print this usage information.
Dart Language Server[8:25:25.110000] -v, --verbose              Show additional command output.
Dart Language Server[8:25:25.110000]     --version              Print the Dart SDK version.
Dart Language Server[8:25:25.110000]     --enable-analytics     Enable analytics.
Dart Language Server[8:25:25.110000]     --disable-analytics    Disable analytics.
Dart Language Server[8:25:25.110000] 
Dart Language Server[8:25:25.110000] Available commands:
Dart Language Server[8:25:25.110000]   analyze    Analyze Dart code in a directory.
Dart Language Server[8:25:25.110000]   compile    Compile Dart to various formats.
Dart Language Server[8:25:25.110000]   create     Create a new Dart project.
Dart Language Server[8:25:25.110000]   devtools   Open DevTools (optionally connecting to an existing application).
Dart Language Server[8:25:25.110000]   doc        Generate HTML API documentation from Dart documentation comments.
Dart Language Server[8:25:25.110000]   fix        Apply automated fixes to Dart source code.
Dart Language Server[8:25:25.110000]   format     Idiomatically format Dart source code.
Dart Language Server[8:25:25.110000]   migrate    Perform null safety migration on a project.
Dart Language Server[8:25:25.110000]   pub        Work with packages.
Dart Language Server[8:25:25.110000]   run        Run a Dart program.
Dart Language Server[8:25:25.110000]   test       Run tests for a project.
Dart Language Server[8:25:25.110000] 
Dart Language Server[8:25:25.110000] Run "dart help <command>" for more information about a command.
Dart Language Server[8:25:25.110000] See https://dart.dev/tools/dart-tool for detailed documentation.

First issue is that the picker should only allow a FOLDER to be select, not a FILE.
The good thing is that you can manually input text into the input (thank u for that).
So the next issue is, What is this?

Dart[8:31:58.134000] Activating...

Dart[8:31:58.134000] Analyzer path is: /Users/pedroluz/dart-sdk/bin/snapshots/analysis_server.dart.snapshot

Dart[8:31:58.144000] LSP Running

Dart Language Server[8:31:58.174000] Wrong full snapshot version, expected 'd56742caf7b3b3f4bd2df93a9bbb5503' found '9cf77f4405212c45daf608e1cd646852'

Thanks

@Narven
Copy link
Author

Narven commented Feb 10, 2022

Dart[8:45:46.330000] Activating...
Dart[8:45:46.331000] Analyzer path is: /Users/pedroluz/dart-sdk/bin/snapshots/analysis_server.dart.snapshot
Dart[8:45:46.333000] LSP Running
Dart Language Server[8:45:47.039000] Wrong full snapshot version, expected 'd56742caf7b3b3f4bd2df93a9bbb5503' found '9cf77f4405212c45daf608e1cd646852'
Dart[8:45:49.215000] Flutter 2.11.0-0.0.pre.501 • channel master • ssh://git@github.com/flutter/flutter.git
Dart[8:45:49.215000] Framework • revision 0ce527eb91 (10 hours ago) • 2022-02-09 15:05:03 -0800
Dart[8:45:49.215000] Engine • revision a57061eda8
Dart[8:45:49.216000] Tools • Dart 2.17.0 (build 2.17.0-87.0.dev) • DevTools 2.10.0

@Narven
Copy link
Author

Narven commented Feb 10, 2022

just fixed by running:

flutter channel master
flutter upgrade
flutter clean

@Narven
Copy link
Author

Narven commented Feb 10, 2022

But I still get a popup box that says:

Dart Language Server stopped unexpectedly,
Error: Task “sciencefidelity.dart” exited with a non-zero exit status: 255.

But it does not show anything specific in the logs, rather than before

@sciencefidelity
Copy link
Owner

Thanks for reporting this.

I've removed temporarily any functionality that tries to find Dart, as it seems problematic. I'll continue to work on that when I have time.

I have added the ability to choose either a folder or a file with the picker in preferences, it does not matter if you choose the analysis_server.dart.snapshot file or the snapshots folder, the extension should fix the path and not double the filename. I've tested it and it works for me, if you see continue to get problems let me know.

There is a new version in the extension library.

@sciencefidelity
Copy link
Owner

But I still get a popup box that says:

Dart Language Server stopped unexpectedly,
Error: Task “sciencefidelity.dart” exited with a non-zero exit status: 255.

But it does not show anything specific in the logs, rather than before

I'll try to figure out why this is happening, have you noticed anything specific that causes this?

@Narven
Copy link
Author

Narven commented Feb 14, 2022

The main reason why I've been seeing that Task "sicencefidelity.dart"... is due to:

Dart[9:44:27.206000] Activating...
Dart[9:44:27.210000] LSP Running
Dart Language Server[9:44:27.238000] Wrong full snapshot version, expected 'd56742caf7b3b3f4bd2df93a9bbb5503' found '9cf77f4405212c45daf608e1cd646852'

I've ran:

flutter channel master
flutter upgrade
flutter clean

which worked before, but is not working anymore. still get that error.

I'm pretty sure that is not an issue with the extension, but with LSP it self. Just dont know why is comparing to commit hashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants