This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Add clangd.serverInfo command to inspect server state.
Needs ReviewPublic

Authored by sammccall on Oct 5 2018, 9:57 AM.

Details

Reviewers
ioeric
Summary

Initially just export the information that's easily available.
(I want to measure changes in dynamic index size, so this is good enough for now)

Event Timeline

sammccall created this revision.Oct 5 2018, 9:57 AM
ioeric added a comment.Oct 8 2018, 2:22 AM

How will this command be triggered? What's the advantage comparing to vloging?

Rather than use a workspace/executeCommand command, you may consider making it a custom request message whose method name starts with $/

https://microsoft.github.io/language-server-protocol/specification

Notification and requests whose methods start with ‘$/’ are messages which are protocol implementation dependent and might not be implementable in all clients or servers. For example if the server implementation uses a single threaded synchronous programming language then there is little a server can do to react to a ‘$/cancelRequest’. If a server or client receives notifications or requests starting with ‘$/’ it is free to ignore them if they are unknown.

The return type of workspace/executeCommand is any | null per spec, but its interpretation may not be that flexible in some clients. It is pretty simple to use lsp-mode eglot vscode-languageclient to send custom request messages, though.