Skip to content

Dynamic registration of call hierarchy and type hierarchy is ignored, as it's looked up under textDocument/callHierarchy and textDocument/typeHierarchy #2250

Done

Description

@lagergren

What happens

LSP4IJ announces textDocument.callHierarchy.dynamicRegistration: true and textDocument.typeHierarchy.dynamicRegistration: true (ClientCapabilitiesFactory, lines 320 and 323). But a server that registers either feature dynamically never gets it: call and type hierarchy stay off for that server.

Cause

A dynamic registration names the request's method: textDocument/prepareCallHierarchy or textDocument/prepareTypeHierarchy, as in the spec. LSPClientFeatures.getCapabilityRegistry(String method) maps LSPRequestConstants.TEXT_DOCUMENT_CALL_HIERARCHY ("textDocument/callHierarchy") and TEXT_DOCUMENT_TYPE_HIERARCHY ("textDocument/typeHierarchy") to the feature registries. Those aren't LSP methods, so LanguageServerWrapper.registerCapability finds no registry for the real methods, and drops the registration.

Fix

Map TEXT_DOCUMENT_PREPARE_CALL_HIERARCHY and TEXT_DOCUMENT_PREPARE_TYPE_HIERARCHY, which LSPRequestConstants already defines, in getCapabilityRegistry. Keep the old keys too, in case a server uses them. Test it with a mock server that registers textDocument/prepareCallHierarchy dynamically.

Activity

  1. added
    bug
    on Nov 25, 2026
  2. added this to the 0.30.2 milestone on Nov 25, 2026
  3. added a commit that references this issue on Nov 26, 2026
    b0865ff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions