Context
The LSP 3.17 spec includes typeHierarchyProvider on ServerCapabilities, but lsp_types 0.97.0 omits it (despite including other 3.17 fields like callHierarchyProvider, inlineValueProvider, inlayHintProvider).
Current workaround
In LspClient::initialize, we deserialize the initialize response to serde_json::Value first, extract typeHierarchyProvider from the raw JSON, store it as supports_type_hierarchy: bool, then deserialize into InitializeResult. See:
src/lsp/client.rs — supports_type_hierarchy field + supports_type_hierarchy() accessor
src/main.rs — extract_capabilities takes a separate type_hierarchy: bool parameter
src/bridge/handler.rs — enrich_symbol gates subtypes enrichment on client.supports_type_hierarchy()
When to remove
When lsp_types adds type_hierarchy_provider to ServerCapabilities:
- Drop the
supports_type_hierarchy field and accessor from LspClient
- Deserialize
initialize directly into InitializeResult again (remove the intermediate Value step)
- Use
caps.type_hierarchy_provider.is_some() like every other capability
- Remove the extra
type_hierarchy parameter from extract_capabilities
Upstream: https://github.com/gluon-lang/lsp-types
Context
The LSP 3.17 spec includes
typeHierarchyProvideronServerCapabilities, butlsp_types0.97.0 omits it (despite including other 3.17 fields likecallHierarchyProvider,inlineValueProvider,inlayHintProvider).Current workaround
In
LspClient::initialize, we deserialize theinitializeresponse toserde_json::Valuefirst, extracttypeHierarchyProviderfrom the raw JSON, store it assupports_type_hierarchy: bool, then deserialize intoInitializeResult. See:src/lsp/client.rs—supports_type_hierarchyfield +supports_type_hierarchy()accessorsrc/main.rs—extract_capabilitiestakes a separatetype_hierarchy: boolparametersrc/bridge/handler.rs—enrich_symbolgates subtypes enrichment onclient.supports_type_hierarchy()When to remove
When
lsp_typesaddstype_hierarchy_providertoServerCapabilities:supports_type_hierarchyfield and accessor fromLspClientinitializedirectly intoInitializeResultagain (remove the intermediateValuestep)caps.type_hierarchy_provider.is_some()like every other capabilitytype_hierarchyparameter fromextract_capabilitiesUpstream: https://github.com/gluon-lang/lsp-types