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.

Respect LSP goToTypeDefinition server capability

Max Brunsfeld11dbbcc9ddfe
diff --git a/crates/project/src/lsp_command.rs b/crates/project/src/lsp_command.rs
index 2d4bed760d1..8435de71e2f 100644
--- a/crates/project/src/lsp_command.rs
+++ b/crates/project/src/lsp_command.rs
@@ -487,6 +487,14 @@ impl LspCommand for GetTypeDefinition {
type LspRequest = lsp::request::GotoTypeDefinition;
type ProtoRequest = proto::GetTypeDefinition;
+ fn check_capabilities(&self, capabilities: &ServerCapabilities) -> bool {
+ match &capabilities.type_definition_provider {
+ None => false,
+ Some(lsp::TypeDefinitionProviderCapability::Simple(false)) => false,
+ _ => true,
+ }
+ }
+
fn to_lsp(
&self,
path: &Path,