-
Notifications
You must be signed in to change notification settings - Fork 13
Description
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:
Lines 264 to 278 in 544517f
| 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.