From 2cae6f3e088b1031a0a3ffe304613b1aaed454d1 Mon Sep 17 00:00:00 2001 From: Yohanes Bandung Bondowoso Date: Mon, 16 Sep 2024 22:03:51 +0700 Subject: [PATCH] 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 --- docs/src/languages/dart.md | 17 ++++++++++++ extensions/dart/extension.toml | 2 +- extensions/dart/src/dart.rs | 51 ++++++++++++++++++++++++++++++---- 3 files changed, 63 insertions(+), 7 deletions(-) diff --git a/docs/src/languages/dart.md b/docs/src/languages/dart.md index 6f80857c88..6571166b6d 100644 --- a/docs/src/languages/dart.md +++ b/docs/src/languages/dart.md @@ -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"] + } + } + } +} +``` +