[clangd-dev] Querying the index for derived classes

Nathan Ridge via clangd-dev clangd-dev at lists.llvm.org
Thu Jan 10 17:14:06 PST 2019


Hi!

I'm looking at implementing support for a proposed LSP protocol extension "textDocument/subTypes", which, given the location of a symbol naming a class type, returns information about its derived classes.

(For context, this is part of the same Type Hierarchy proposal [1] which also includes "textDocument/superTypes", which I've already implemented and posted about separately [2].)

Unlike "superTypes", for which all the necessary information is in the AST, "subTypes" requires an index query to locate derived types.

Based on my current understanding of clangd's index, the information currently stored in the index is not sufficient to implement such a query efficiently. It seems to me that the index would need a mechanism to record relationships between symbols; for example, for each symbol, to store a list of pointers to other symbols which are the derived classes.

Is there interest in extending the type of information stored in clangd's index along these lines?

I also recall a presentation by Apple [3] about storing relationships like this in the index. Does anyone know what the current status of that effort is?

Thanks,
Nate

[1] https://github.com/Microsoft/vscode-languageserver-node/pull/426
[2] http://lists.llvm.org/pipermail/clangd-dev/2019-January/000238.html
[3] https://www.youtube.com/watch?v=jGJhnIT-D2M


More information about the clangd-dev mailing list