Skip to content

Commit

Permalink
indexer: set the kind of static data members to Field instead of Var
Browse files Browse the repository at this point in the history
Otherwise it is impossible to distinguish a static variable from a
static member variable.

Close #593
  • Loading branch information
FederAndInk authored and MaskRay committed Apr 22, 2020
1 parent de800eb commit c5acf62
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/indexer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,14 @@ Kind getKind(const Decl *d, SymbolKind &kind) {
// ccls extension
kind = SymbolKind::Parameter;
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:
kind = SymbolKind::Variable;
return Kind::Var;
Expand Down

0 comments on commit c5acf62

Please sign in to comment.