Respect language server's capabilities when calling GetReferences
(#10285)
This PR makes Zed respect the language server's capabilities when calling the `GetReferences` command (used in "Find All References", etc.). This fixes a crash that could occur when using Zed with Gleam v1.0. Release Notes: - Made "Find All References" respect the language server's capabilities. This fixes some instances where certain language servers would stop working after receiving a "Find All References" request. --------- Co-authored-by: Max <max@zed.dev>
This commit is contained in:
parent
f1428fea4e
commit
56c0345cf3
2 changed files with 18 additions and 3 deletions
|
@ -903,6 +903,14 @@ impl LspCommand for GetReferences {
|
|||
return Some("Finding references...".to_owned());
|
||||
}
|
||||
|
||||
fn check_capabilities(&self, capabilities: &ServerCapabilities) -> bool {
|
||||
match &capabilities.references_provider {
|
||||
Some(OneOf::Left(has_support)) => *has_support,
|
||||
Some(OneOf::Right(_)) => true,
|
||||
None => false,
|
||||
}
|
||||
}
|
||||
|
||||
fn to_lsp(
|
||||
&self,
|
||||
path: &Path,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue