Announce supported capabilities #393
Replies: 2 comments 4 replies
-
You need to config which features should enable by See https://github.com/yaegassy/coc-volar/blob/master/src/index.ts#L129-L182. |
Beta Was this translation helpful? Give feedback.
-
Based on the I tried to supply only the The But reguardless I also tried adding both languageFeatures and documentFeatures in the initialization options, Here is how my initializationOptions looked like: // Settings in here override those in "LSP-volar/LSP-volar.sublime-settings"
{
"command": ["${node_bin}", "/home/predragnikolic/Documents/sandbox/volar/packages/server/out/index.js", "--stdio"],
"initializationOptions": {
"typescript": {
"serverPath": "/home/predragnikolic/.npm-global/lib/node_modules/typescript/lib/typescript.js",
},
"languageFeatures": {
"references": true,
"definition": true,
"typeDefinition": true,
"callHierarchy": false,
"hover": true,
"rename": true,
"renameFileRefactoring": false,
"signatureHelp": true,
"codeAction": true,
"completion": {
"defaultTagNameCase": "both",
"defaultAttrNameCase": "kebab",
"getDocumentNameCasesRequest": false,
"getDocumentSelectionRequest": false,
},
"documentHighlight": true,
"documentLink": false,
"codeLens": false,
"semanticTokens": false,
"schemaRequestService": false,
"diagnostics": true
},
"documentFeatures": {
"selectionRange": true,
"foldingRange": true,
"linkedEditingRange": false,
"documentSymbol": true,
"documentColor": true,
"documentFormatting": {
"defaultPrintWidth": 90
}
}
}
}
I am not sure what I am doing wrong. Even when the LSP client needs to send server capabilities in initialization options (which I think should not be a clients responsibility :) ), Additional question: I saw the code in Why is there a need to create 3 separate language handlers: |
Beta Was this translation helpful? Give feedback.
-
LSP clients(like Sublime Text), won't send server requests if the server didn't announce support for those requests through capabilities.
Currently the Volar server only announces this capability:
https://github.com/johnsoncodehk/volar/blob/8733e9483389d9567525f0493b56697fe8f2c35a/packages/server/src/index.ts#L34-L36
But it should actually include lots of other capabilities.
Here is an example of what the Vetur server returns:
Note: I accidentally lowercased all the object keys :)
Additional context:
Even when I add a completion capability for completions:
When a LSP client sends a request to Volar,
Volar returns this error:
So even when Volar has specified capabilities, the server still will not work with other LSP clients (just yet :). Do you have any idea why?
Beta Was this translation helpful? Give feedback.
All reactions