From c5acf62060f32f79b4647fd63c05e6b1a9135e6f Mon Sep 17 00:00:00 2001 From: Ludovic Jozeau Date: Sun, 5 Apr 2020 17:53:27 +0200 Subject: [PATCH] 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 --- src/indexer.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/indexer.cc b/src/indexer.cc index 4c7a262c..7b7c1480 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -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(d); + if (vd->isStaticDataMember()) { + kind = SymbolKind::Field; + return Kind::Var; + } + [[fallthrough]]; + } case Decl::Decomposition: kind = SymbolKind::Variable; return Kind::Var;