Skip to content

Remove typeHierarchyProvider workaround when lsp_types adds the field #24

@m-wells

Description

@m-wells

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.rssupports_type_hierarchy field + supports_type_hierarchy() accessor
  • src/main.rsextract_capabilities takes a separate type_hierarchy: bool parameter
  • src/bridge/handler.rsenrich_symbol gates subtypes enrichment on client.supports_type_hierarchy()

When to remove

When lsp_types adds type_hierarchy_provider to ServerCapabilities:

  1. Drop the supports_type_hierarchy field and accessor from LspClient
  2. Deserialize initialize directly into InitializeResult again (remove the intermediate Value step)
  3. Use caps.type_hierarchy_provider.is_some() like every other capability
  4. Remove the extra type_hierarchy parameter from extract_capabilities

Upstream: https://github.com/gluon-lang/lsp-types

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions