diff --git a/src/indexer.cc b/src/indexer.cc index bf33b760..aaeff0b5 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -125,9 +125,9 @@ lsSymbolKind GetSymbolKind(CXIdxEntityKind kind) { case CXIdxEntity_ObjCInstanceMethod: return lsSymbolKind::Method; case CXIdxEntity_ObjCClassMethod: - return lsSymbolKind::Method; + return lsSymbolKind::StaticMethod; case CXIdxEntity_CXXStaticMethod: - return lsSymbolKind::Method; + return lsSymbolKind::StaticMethod; case CXIdxEntity_ObjCProperty: return lsSymbolKind::Property; case CXIdxEntity_CXXStaticVariable: diff --git a/src/message_handler.cc b/src/message_handler.cc index b06b2023..b4f2aaa5 100644 --- a/src/message_handler.cc +++ b/src/message_handler.cc @@ -126,6 +126,8 @@ void EmitSemanticHighlighting(QueryDatabase* db, if (short_name.compare(0, 8, "operator") == 0 || short_name.compare(0, 27, "functionspell) + parent_kind = def->spell->kind; kind = def->kind; detailed_name = short_name; @@ -149,6 +151,8 @@ void EmitSemanticHighlighting(QueryDatabase* db, } case SymbolKind::Var: { if (const QueryVar::Def* def = db->GetVar(sym).AnyDef()) { + if (def->spell) + parent_kind = def->spell->kind; kind = def->kind; storage = def->storage; detailed_name = def->ShortName(); @@ -157,6 +161,8 @@ void EmitSemanticHighlighting(QueryDatabase* db, } case SymbolKind::Type: { if (const QueryType::Def* def = db->GetType(sym).AnyDef()) { + if (def->spell) + parent_kind = def->spell->kind; kind = def->kind; detailed_name = def->detailed_name; } diff --git a/src/symbol.h b/src/symbol.h index d9cee2f6..99c19da2 100644 --- a/src/symbol.h +++ b/src/symbol.h @@ -112,6 +112,7 @@ enum class lsSymbolKind : uint8_t { // See also https://github.com/Microsoft/language-server-protocol/issues/344 for new SymbolKind // clang/Index/IndexSymbol.h clang::index::SymbolKind Parameter = 13, + StaticMethod = 254, Macro = 255, }; MAKE_REFLECT_TYPE_PROXY(lsSymbolKind);