mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 15:45:08 +00:00
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:
parent
de800ebb70
commit
c5acf62060
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user