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

Nathan Ridge via clangd-dev clangd-dev at lists.llvm.org
Tue Jan 15 20:59:03 PST 2019


> And thinking more about the interaction - it seems that a type hierarchy 
> that shows both base and derived classes might be most useful. Do 
> you know why the super/sub types are proposed as separate methods?

All the UI's I've seen indeed show a single hierarchy.

I think the super/sub separation is mostly just a convenience at the protocol level. It makes it easier to query the tree lazily (one level at a time), and also to reuse DocumentSymbol's "children" field to represent the tree.

I don't think there's any conflict between the protocol having two parts, and the UI showing a single tree.

> VSCode in particular seems to get all its structure-awareness from 
> language servers. Do you know where it gets data for type hierarchy? 
> Practically speaking, what VSCode wants seems to drive about 80% of 
> what gets standardized.

I had another look, and it looks like the VSCode type hierarchy UI that I was thinking of comes from the vscode-cquery extension [1], which uses a cquery protocol extension to get the data from the server. (I believe the cquery feature predates the standard protocol proposal.)

VSCode itself does not appear to have a generic type hierarchy UI yet; I expect it will get one as standardization of the protocol progresses.

Thanks,
Nate

[1] https://github.com/cquery-project/vscode-cquery/blob/master/src/inheritanceHierarchy.ts


More information about the clangd-dev mailing list