[PATCH] D35894: [clangd] Code hover for Clangd
Ilya Biryukov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 2 00:25:46 PDT 2017
ilya-biryukov added a reviewer: ilya-biryukov.
ilya-biryukov requested changes to this revision.
ilya-biryukov added a comment.
I just wanted to take a step back and discuss what we want to get from code hover in the first place.
I would expect a typical code hover to be a bit more involved and include:
- "kind" of a symbol under hover (i.e. a MACRO, global function, typedef, class/struct),
- type of the symbol, if applicable (i.e. types for local vars, typedefs, etc.),
- name of the symbol,
- containing namespace/class information (i.e. "member of namespace std", "member of class std::vector"),
- doc comment, if any.
We could start with a subset of those.
This could be implemented by reusing the code of `findDefinitions` that gets all `Decl` and `MacroDefinition` instances, referenced in the current location.
When you have a `Decl` or `MacroDefinition`, you could pretty-print the hover text.
https://reviews.llvm.org/D35894
More information about the cfe-commits
mailing list