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.

Include loaded languages when computing lsp workspace configuration

Antonio Scandurrae30ea43a14b2
diff --git a/crates/language/src/language.rs b/crates/language/src/language.rs
index 59fca33fb60..cb4f5c7b87e 100644
--- a/crates/language/src/language.rs
+++ b/crates/language/src/language.rs
@@ -133,6 +133,13 @@ impl CachedLspAdapter {
self.adapter.cached_server_binary(container_dir).await
}
+ pub fn workspace_configuration(
+ &self,
+ cx: &mut MutableAppContext,
+ ) -> Option<BoxFuture<'static, Value>> {
+ self.adapter.workspace_configuration(cx)
+ }
+
pub async fn process_diagnostics(&self, params: &mut lsp::PublishDiagnosticsParams) {
self.adapter.process_diagnostics(params).await
}
@@ -557,6 +564,13 @@ impl LanguageRegistry {
}
}
}
+ for language in self.languages.read().iter() {
+ if let Some(adapter) = language.lsp_adapter() {
+ if let Some(language_config) = adapter.workspace_configuration(cx) {
+ language_configs.push(language_config);
+ }
+ }
+ }
cx.background().spawn(async move {
let mut config = serde_json::json!({});