[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
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  which also includes "textDocument/superTypes", which I've already implemented and posted about separately .)
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  about storing relationships like this in the index. Does anyone know what the current status of that effort is?
More information about the clangd-dev