Description
codeAction and codeLens are valuable generic hooks for the server to provide features.
These features are limited by what actions LSP allows the server to trigger on the client.
Today the most useful are: applyTextEdits
, showMessage
, showDocument
(new, thanks!).
It'd be a nice addition to be able to publish a list of locations, similar to how textDocument/references
results are displayed.
The most obvious use case: "show references" is the stock example of a code lens, but can't be implemented directly in LSP today. (It requires some extension like a known Command name that is handled by an editor plugin).
#788 suggests to standardize some such Commands, but a server->client request would be more composable, easier to document, be guarded by capabilities in a better-understood way, etc.
(clangd is considering implementing this as an extension as part of our codeLens support, in order to clearly document what client support is required)