Skip to content

Dynamic registration of parametric LSP capabilities #955

@toinehartman

Description

@toinehartman

Is your feature request related to a problem? Please describe.

Currently, the parametric LSP servers registers capabilities (i.e. supported LSP features) statically at initialization time. Any time a new LSP feature is added to our LSP implementation, this list is updated:

result.setDefinitionProvider(true);
result.setTextDocumentSync(TextDocumentSyncKind.Full);
result.setHoverProvider(true);
result.setReferencesProvider(true);
result.setDocumentSymbolProvider(true);
result.setImplementationProvider(true);
result.setSemanticTokensProvider(tokenizer.options());
result.setCodeActionProvider(true);
result.setCodeLensProvider(new CodeLensOptions(false));
result.setRenameProvider(new RenameOptions(true));
result.setExecuteCommandProvider(new ExecuteCommandOptions(Collections.singletonList(getRascalMetaCommandName())));
result.setInlayHintProvider(true);
result.setSelectionRangeProvider(true);
result.setFoldingRangeProvider(true);
result.setCallHierarchyProvider(true);

In other words: the parametric server claims to support a plethora of features. However, when the registered language does not actually implement the feature, it falls back to a default implementation, as if the feature was not supported at all.

The parametric server gives a false representation of features it supports, which results in many useless requests.

Describe the solution you'd like

Register language features dynamically at the time of language registration.

Describe alternatives you've considered

-

Additional context

First example of dynamic registration is in #706.
Related to #954.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions