[clangd-dev] Landing support for LSP protocol extensions?

Nathan Ridge via clangd-dev clangd-dev at lists.llvm.org
Thu Jan 10 16:48:25 PST 2019


Hi there!

I've written a patch [1] to add support to clangd for the "textDocument/superTypes" request, which, given the location of a symbol naming a class type, returns information about its base classes.

This is not part of the LSP specification yet, though it has been proposed for addition [2], and has been implemented in at least one client (Theia [3], not merged yet).

(There is also a "textDocument/subTypes" request in the proposal, which returns information about derived classes. That's more challenging to implement; stay tuned for a separate post about that.)

Is clangd interested in support for protocol extensions like this landing, in any form, prior to their standardization in LSP?

If so, are there any measures that should be taken to reflect that the protocol is not yet standard? For example:

* cquery (another C++ language server [4]) puts non-standard protocols into a "$cquery" namespace, e.g. "$cquery/typeHierarchy" rather than "textDocument/typeHierarchy". clangd could potentially do the same.

* The protocol could be available under the standard name, but behind a command-line flag and not enabled by default.

Any thoughts on this subject are appreciated!

Thanks,
Nate

[1] https://reviews.llvm.org/D56370
[2] https://github.com/Microsoft/vscode-languageserver-node/pull/426
[3] https://github.com/theia-ide/theia/pull/3802
[4] https://github.com/cquery-project/cquery


More information about the clangd-dev mailing list