dart: Respect LSP binary settings (#17494)

Enable configuring Dart's LSP from other means of installation types.

Some users don't install the `dart` binary, but uses version manager.

In the example, I uses [FVM](https://fvm.app/) (short for "Flutter
Version Manager").

I have tested this with "Install Dev Extensions".

Release Notes:

- N/A

cc other maintainer: @agent3bood @flo80

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This commit is contained in:
Yohanes Bandung Bondowoso
2024-09-16 11:03:51 -04:00
committed by GitHub
co-authored by Marshall Bowers
parent 2baa704af7
commit 2cae6f3e08
3 changed files with 63 additions and 7 deletions
+17
View File
@@ -5,6 +5,23 @@ Dart support is available through the [Dart extension](https://github.com/zed-in
- Tree Sitter: [UserNobody14/tree-sitter-dart](https://github.com/UserNobody14/tree-sitter-dart)
- Language Server: [dart language-server](https://github.com/dart-lang/sdk)
## Configuration
The `dart` binary can be configured in a Zed settings file with:
```json
{
"lsp": {
"dart": {
"binary": {
"path": "/opt/homebrew/bin/fvm",
"arguments": ["dart", "language-server", "--protocol=lsp"]
}
}
}
}
```
<!--
TBD: Document Dart. pubspec.yaml
- https://github.com/dart-lang/sdk/blob/main/pkg/analysis_server/tool/lsp_spec/README.md