1 year ago
#341773
Jeremy
Nvim LSP dartls is unable to start
I would like to configure a development environment for flutter, I just configured flutter and android studio and I already got a started app running. Now I just need to configure the dartls, I've been playing around with the cmd property since it looks like the default configuration is not able to find the executable. Since flutter packages the dart-sdk along with it, I changed the path accordingly.
require'lspconfig'.dartls.setup{
cmd = {"dart", "~/source/flutter/bin/cache/dart-sdk/bin/snapshots/analysis_server.dart.snapshot", "--protocol=lsp"},
on_attach = on_attach
}
Are you sure this is the right path?
ls ~/source/flutter/bin/cache/dart-sdk/bin/snapshots/ | grep analysis_server
# analysis_server.dart.snapshot
Why did you change the --lsp flag?
dart ~/source/flutter/bin/cache/dart-sdk/bin/snapshots/analysis_server.dart.snapshot --help | grep protocol
--protocol=<protocol> Specify the protocol to use to communicate with the analysis server.
[analyzer] (default) Dart's analysis server protocol (https://dart.dev/go/analysis-server-protocol)
[lsp] The Language Server Protocol (https://microsoft.github.io/language-server-protocol)
Are you receiving any errors when opening a dart file?
Spawning language server with cmd: `dart` failed. The language server is either not installed, missing from PATH, or not executable.
flutter
dart
neovim
nvim-lspconfig
0 Answers
Your Answer