Fix semantic highlighting regressions from switch from ClangSymbolKind to lsSymbolKind (fixes #469)

This commit is contained in:
Nathan Ridge 2018-02-22 18:43:39 -05:00 committed by Jacob Dufault
parent d4c49730fd
commit 9f4b30ca8c
2 changed files with 8 additions and 4 deletions

View File

@ -118,7 +118,7 @@ lsSymbolKind GetSymbolKind(CXIdxEntityKind kind) {
return lsSymbolKind::Struct;
case CXIdxEntity_CXXTypeAlias:
case CXIdxEntity_Typedef:
return lsSymbolKind::TypeParameter;
return lsSymbolKind::TypeAlias;
case CXIdxEntity_Function:
return lsSymbolKind::Function;
@ -1310,7 +1310,7 @@ ClangCursor::VisitResult TemplateVisitor(ClangCursor cursor,
ref_var->def.extent =
SetUse(db, ref_cursor.get_extent(), lex_parent, Role::None);
ref_var = db->Resolve(ref_var_id);
ref_var->def.kind = lsSymbolKind::Parameter;
ref_var->def.kind = lsSymbolKind::TypeParameter;
SetVarDetail(ref_var, ref_cursor.get_spell_name(), ref_cursor,
nullptr, true, db, param);

View File

@ -107,12 +107,16 @@ enum class lsSymbolKind : uint8_t {
Struct = 23,
Event = 24,
Operator = 25,
TypeParameter = 26,
// For C++, this is interpreted as "template parameter" (including
// non-type template parameters).
TypeParameter = 26,
// cquery extensions
// See also https://github.com/Microsoft/language-server-protocol/issues/344
// for new SymbolKind clang/Index/IndexSymbol.h clang::index::SymbolKind
Parameter = 13,
TypeAlias = 252,
Parameter = 253,
StaticMethod = 254,
Macro = 255,
};