pascal-language-server icon indicating copy to clipboard operation
pascal-language-server copied to clipboard

Language Server Reports too few Capabilities

Open mskamp opened this issue 10 months ago • 4 comments

With a build of the latest trunk, the language server claims to support a very limited set of capabilities:

"capabilities":{"referencesProvider":false,"executeCommandProvider":{"commands":["pasls.formatCode","pasls.completeCode","pasls.invertAssignment","pasls.removeEmptyMethods"]},"documentHighlightProvider":false,"hoverProvider":false,"workspaceSymbolProvider":false,"declarationProvider":false,"signatureHelpProvider":{"triggerCharacters":[]},"documentSymbolProvider":true,"definitionProvider":false,"workspace":{"workspaceFolders":{"changeNotifications":false,"supported":false}},"textDocumentSync":{"save":{"includeText":false},"willSaveWaitUntil":false,"willSave":false,"change":1,"openClose":true},"codeActionProvider":false,"completionProvider":{"allCommitCharacters":[],"resolveProvider":false,"triggerCharacters":[]},"implementationProvider":false}

For example, since "referencesProvider":false, the language server claims to not support the “references” method, contrary to what is claimed in README.md.

It appears that this behavior has changed with commit d70ca94dcff452406ca154d8871300a099d3c24b. Notably, the call to ApplySettings has been removed but not inserted again. The logic for setting capabilities like "referencesProvider", however, has been moved to ApplySettings. Yet, this method is never called.

When adding a call to ApplySettings in PasLS.General.pas:443, the reported capabilities change as follows:

"capabilities":{"referencesProvider":true,"executeCommandProvider":{"commands":["pasls.formatCode","pasls.completeCode","pasls.invertAssignment","pasls.removeEmptyMethods"]},"documentHighlightProvider":true,"hoverProvider":true,"workspaceSymbolProvider":false,"declarationProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",")",","]},"documentSymbolProvider":true,"definitionProvider":true,"workspace":{"workspaceFolders":{"changeNotifications":true,"supported":true}},"textDocumentSync":{"save":{"includeText":false},"willSaveWaitUntil":false,"willSave":false,"change":1,"openClose":true},"codeActionProvider":false,"completionProvider":{"allCommitCharacters":[],"resolveProvider":false,"triggerCharacters":[".","^"]},"implementationProvider":true}

This list is more in line with the claims in README.md. Still, I'm not sure where ApplySettings is supposed to be called and if the position noted above is the intended one.

mskamp avatar Mar 31 '24 10:03 mskamp