indexer: set the kind of static data members to Field instead of Var

Otherwise it is impossible to distinguish a static variable from a
static member variable.

Close #593
This commit is contained in:
Ludovic Jozeau 2020-04-05 17:53:27 +02:00 committed by Fangrui Song
parent de800ebb70
commit c5acf62060

View File

@ -196,7 +196,14 @@ Kind getKind(const Decl *d, SymbolKind &kind) {
// ccls extension // ccls extension
kind = SymbolKind::Parameter; kind = SymbolKind::Parameter;
return Kind::Var; return Kind::Var;
case Decl::Var: case Decl::Var: {
auto vd = cast<VarDecl>(d);
if (vd->isStaticDataMember()) {
kind = SymbolKind::Field;
return Kind::Var;
}
[[fallthrough]];
}
case Decl::Decomposition: case Decl::Decomposition:
kind = SymbolKind::Variable; kind = SymbolKind::Variable;
return Kind::Var; return Kind::Var;