mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-31 19:05:00 +07:00
lsp: Handle dynamic registration of textDocument/documentLink (#57749)
`register_server_capabilities` / `unregister_server_capabilities` had no arm for `textDocument/documentLink`, so when a server saw our `documentLink.dynamicRegistration` capability and chose to register the provider dynamically, the registration silently fell into the `unhandled capability registration` warning. `document_link_provider` stayed `None`, `GetDocumentLinks::check_capabilities` returned false, and no `textDocument/documentLink` request was ever sent. Follow-up to https://github.com/zed-industries/zed/pull/56011 Release Notes: - N/A Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
c551ec93b0
commit
efacf30294
1 changed files with 18 additions and 0 deletions
|
|
@ -13076,6 +13076,18 @@ impl LspStore {
|
|||
});
|
||||
notify_server_capabilities_updated(&server, cx);
|
||||
}
|
||||
"textDocument/documentLink" => {
|
||||
if let Some(caps) = reg
|
||||
.register_options
|
||||
.map(serde_json::from_value)
|
||||
.transpose()?
|
||||
{
|
||||
server.update_capabilities(|capabilities| {
|
||||
capabilities.document_link_provider = Some(caps);
|
||||
});
|
||||
notify_server_capabilities_updated(&server, cx);
|
||||
}
|
||||
}
|
||||
_ => log::warn!("unhandled capability registration: {reg:?}"),
|
||||
}
|
||||
}
|
||||
|
|
@ -13279,6 +13291,12 @@ impl LspStore {
|
|||
});
|
||||
notify_server_capabilities_updated(&server, cx);
|
||||
}
|
||||
"textDocument/documentLink" => {
|
||||
server.update_capabilities(|capabilities| {
|
||||
capabilities.document_link_provider = None;
|
||||
});
|
||||
notify_server_capabilities_updated(&server, cx);
|
||||
}
|
||||
_ => log::warn!("unhandled capability unregistration: {unreg:?}"),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue