Closed icylogic closed 5 years ago
Sorry that I have squashed the commit. It is now https://github.com/MaskRay/ccls/commit/da704521b550606ad0cf3c8dcff8ad2efb54d02e
This is a breaking change.
What ccls did (inherited from cquery):
1000 refs
(clickable button that encodes 1000 Location[]
)Location[]
are encoded in the textDocument/codeLens
response, which increases the size a lot and it also takes some time for the server to render this piece of information.After the refactoring (the commit you've observed),
https://github.com/maskray/ccls/blob/master/src/messages/textDocument_codeLens.cc#L40
what the server returns now is:
"command":{
"title":"1 var",
"command":"ccls.xref",
"arguments":["{\"usr\":16926293689053220079,\"kind\":2,\"field\":\"instances\"}"]}}
See https://microsoft.github.io/language-server-protocol/specification result: CodeLens[] | null defined as follows:
The Location[]
has been replaced with "arguments"
. When the user clicks the lens button, it sends a workspace/executeCommand
request (https://github.com/Microsoft/vscode/blob/c388220ff2ba9953569518d842eb2405b89517bc/src/vs/editor/contrib/codelens/codelensWidget.ts#L96) to the server and the server returns Location[]
. This improves the performance a lot.
Codelens is still broken. Is a fix for this on the roadmap?
Riatre has a fix that diverges from this repository https://github.com/Riatre/vscode-ccls/commit/16690d0c4bb63981950fea070f8f3e5faaec9a10 Someone can pick it up
Since CodeLens has changed in the latest commit https://github.com/MaskRay/ccls/commit/8c807685ab1200b404303d2d6954a06ec176cb9c
The result of requesting
textDocument/codeLens
changed fromto
but I have no idea how to process it.