[PATCH] D73696: [clang][Index] Introduce a TemplateParm SymbolKind
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 5 03:24:26 PST 2020
sammccall added a comment.
Libclang changes need tests I think.
================
Comment at: clang-tools-extra/clangd/Protocol.cpp:265
case index::SymbolKind::Parameter:
+ case index::SymbolKind::TemplateParm:
return SymbolKind::Variable;
----------------
this seems kind of dubious, maybe worth a comment?
(If we had the decl here we'd distinguish between type and non-type, right?)
================
Comment at: clang-tools-extra/clangd/unittests/HoverTests.cpp:586
+ HI.LocalScope = "foo::";
+ }},
+ {// TemplateTemplate Type Parameter
----------------
I do think we're going to want to have `HI.Type = "typename"` here, maybe with some special-case in the rendering.
(Especially with concepts where the TTP can be constrained as Integral or something)
Fine to leave for now but FIXME somewhere?
================
Comment at: clang/include/clang-c/Index.h:6257
+ CXIdxEntity_CXXInterface = 26,
+ CXIdxEntity_CXXTemplateParm = 27
----------------
As far as hover goes, calling this "template parameter" and making int/class the "type" is cute and fits well.
But I worry we're not exposing enough info here and at the libclang level (and I guess Index) we should be distinguishing the 3 cases. WDYT?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73696/new/
https://reviews.llvm.org/D73696
More information about the cfe-commits
mailing list