Use a better type for language IDs field (#35566)
Part of the preparation for proto capabilities. Release Notes: - N/A
This commit is contained in:
parent
1b3d6139b8
commit
5ca5d90234
9 changed files with 52 additions and 50 deletions
|
@ -3580,6 +3580,18 @@ impl LspCommand for GetCodeLens {
|
|||
}
|
||||
}
|
||||
|
||||
impl LinkedEditingRange {
|
||||
pub fn check_server_capabilities(capabilities: ServerCapabilities) -> bool {
|
||||
let Some(linked_editing_options) = capabilities.linked_editing_range_provider else {
|
||||
return false;
|
||||
};
|
||||
if let LinkedEditingRangeServerCapabilities::Simple(false) = linked_editing_options {
|
||||
return false;
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait(?Send)]
|
||||
impl LspCommand for LinkedEditingRange {
|
||||
type Response = Vec<Range<Anchor>>;
|
||||
|
@ -3591,16 +3603,7 @@ impl LspCommand for LinkedEditingRange {
|
|||
}
|
||||
|
||||
fn check_capabilities(&self, capabilities: AdapterServerCapabilities) -> bool {
|
||||
let Some(linked_editing_options) = &capabilities
|
||||
.server_capabilities
|
||||
.linked_editing_range_provider
|
||||
else {
|
||||
return false;
|
||||
};
|
||||
if let LinkedEditingRangeServerCapabilities::Simple(false) = linked_editing_options {
|
||||
return false;
|
||||
}
|
||||
true
|
||||
Self::check_server_capabilities(capabilities.server_capabilities)
|
||||
}
|
||||
|
||||
fn to_lsp(
|
||||
|
|
|
@ -5069,10 +5069,7 @@ impl LspStore {
|
|||
local
|
||||
.language_servers_for_buffer(buffer, cx)
|
||||
.filter(|(_, server)| {
|
||||
server
|
||||
.capabilities()
|
||||
.linked_editing_range_provider
|
||||
.is_some()
|
||||
LinkedEditingRange::check_server_capabilities(server.capabilities())
|
||||
})
|
||||
.filter(|(adapter, _)| {
|
||||
scope
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue