Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Implement workspace_configuration for Dart LSP (#8568)

Flod6492d091db9
diff --git a/crates/languages/src/dart.rs b/crates/languages/src/dart.rs
index 744e500615f..bd906e67b1e 100644
--- a/crates/languages/src/dart.rs
+++ b/crates/languages/src/dart.rs
@@ -1,8 +1,15 @@
use anyhow::{anyhow, Result};
use async_trait::async_trait;
+use gpui::AppContext;
use language::{LanguageServerName, LspAdapter, LspAdapterDelegate};
use lsp::LanguageServerBinary;
-use std::{any::Any, path::PathBuf};
+use project::project_settings::ProjectSettings;
+use serde_json::Value;
+use settings::Settings;
+use std::{
+ any::Any,
+ path::{Path, PathBuf},
+};
pub struct DartLanguageServer;
@@ -51,4 +58,16 @@ impl LspAdapter for DartLanguageServer {
async fn installation_test_binary(&self, _: PathBuf) -> Option<LanguageServerBinary> {
None
}
+
+ fn workspace_configuration(&self, _workspace_root: &Path, cx: &mut AppContext) -> Value {
+ let settings = ProjectSettings::get_global(cx)
+ .lsp
+ .get("dart")
+ .and_then(|s| s.settings.clone())
+ .unwrap_or_default();
+
+ serde_json::json!({
+ "dart": settings
+ })
+ }
}