Skip to content

Commit 209ae44

Browse files
FederAndInkMaskRay
authored andcommitted
static data member as field instead of variable
otherwise this is impossible to distinguish a static variable from a static member variable Close (MaskRay#593)
1 parent de800eb commit 209ae44

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 var = cast<VarDecl>(d);
201+
if (var->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)