lsp: Query first capable language server for requests using primary LS (#25591)
Release Notes: - Improved Zed's handling of the following requests when the first language server in language server settings for a given language is not capable of handling them: - Perform Rename - Prepare Rename - Document Highlights - Find all references - Go to implementation - Go to definition - Go to declaration - Go to type definition
This commit is contained in:
parent
e5b6194914
commit
0066071a89
2 changed files with 105 additions and 99 deletions
|
@ -2777,7 +2777,7 @@ impl Project {
|
|||
) -> Task<Result<Vec<LocationLink>>> {
|
||||
self.request_lsp(
|
||||
buffer.clone(),
|
||||
LanguageServerToQuery::Primary,
|
||||
LanguageServerToQuery::FirstCapable,
|
||||
GetDefinition { position },
|
||||
cx,
|
||||
)
|
||||
|
@ -2800,7 +2800,7 @@ impl Project {
|
|||
) -> Task<Result<Vec<LocationLink>>> {
|
||||
self.request_lsp(
|
||||
buffer.clone(),
|
||||
LanguageServerToQuery::Primary,
|
||||
LanguageServerToQuery::FirstCapable,
|
||||
GetDeclaration { position },
|
||||
cx,
|
||||
)
|
||||
|
@ -2824,7 +2824,7 @@ impl Project {
|
|||
) -> Task<Result<Vec<LocationLink>>> {
|
||||
self.request_lsp(
|
||||
buffer.clone(),
|
||||
LanguageServerToQuery::Primary,
|
||||
LanguageServerToQuery::FirstCapable,
|
||||
GetTypeDefinition { position },
|
||||
cx,
|
||||
)
|
||||
|
@ -2849,7 +2849,7 @@ impl Project {
|
|||
let position = position.to_point_utf16(buffer.read(cx));
|
||||
self.request_lsp(
|
||||
buffer.clone(),
|
||||
LanguageServerToQuery::Primary,
|
||||
LanguageServerToQuery::FirstCapable,
|
||||
GetImplementation { position },
|
||||
cx,
|
||||
)
|
||||
|
@ -2864,7 +2864,7 @@ impl Project {
|
|||
let position = position.to_point_utf16(buffer.read(cx));
|
||||
self.request_lsp(
|
||||
buffer.clone(),
|
||||
LanguageServerToQuery::Primary,
|
||||
LanguageServerToQuery::FirstCapable,
|
||||
GetReferences { position },
|
||||
cx,
|
||||
)
|
||||
|
@ -2878,7 +2878,7 @@ impl Project {
|
|||
) -> Task<Result<Vec<DocumentHighlight>>> {
|
||||
self.request_lsp(
|
||||
buffer.clone(),
|
||||
LanguageServerToQuery::Primary,
|
||||
LanguageServerToQuery::FirstCapable,
|
||||
GetDocumentHighlights { position },
|
||||
cx,
|
||||
)
|
||||
|
@ -3037,7 +3037,7 @@ impl Project {
|
|||
) -> Task<Result<PrepareRenameResponse>> {
|
||||
self.request_lsp(
|
||||
buffer,
|
||||
LanguageServerToQuery::Primary,
|
||||
LanguageServerToQuery::FirstCapable,
|
||||
PrepareRename { position },
|
||||
cx,
|
||||
)
|
||||
|
@ -3063,7 +3063,7 @@ impl Project {
|
|||
let position = position.to_point_utf16(buffer.read(cx));
|
||||
self.request_lsp(
|
||||
buffer,
|
||||
LanguageServerToQuery::Primary,
|
||||
LanguageServerToQuery::FirstCapable,
|
||||
PerformRename {
|
||||
position,
|
||||
new_name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue