Skip to content

Commit c5acf62

Browse files
FederAndInkMaskRay
authored andcommitted
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
1 parent de800eb commit c5acf62

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/indexer.cc

+8-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,14 @@ Kind getKind(const Decl *d, SymbolKind &kind) {
196196
// ccls extension
197197
kind = SymbolKind::Parameter;
198198
return Kind::Var;
199-
case Decl::Var:
199+
case Decl::Var: {
200+
auto vd = cast<VarDecl>(d);
201+
if (vd->isStaticDataMember()) {
202+
kind = SymbolKind::Field;
203+
return Kind::Var;
204+
}
205+
[[fallthrough]];
206+
}
200207
case Decl::Decomposition:
201208
kind = SymbolKind::Variable;
202209
return Kind::Var;

0 commit comments

Comments
 (0)