Support some unhandled Decl::Kind

This commit is contained in:
Fangrui Song 2019-02-23 00:06:44 +08:00
parent 2fc2d1b16c
commit 4b973a86a2
2 changed files with 8 additions and 1 deletions

View File

@ -193,6 +193,10 @@ Kind GetKind(const Decl *D, SymbolKind &kind) {
case Decl::CXXDestructor:
kind = SymbolKind::Method;
return Kind::Func;
case Decl::NonTypeTemplateParm:
// ccls extension
kind = SymbolKind::Parameter;
return Kind::Var;
case Decl::Var:
case Decl::Decomposition:
kind = SymbolKind::Variable;
@ -824,7 +828,7 @@ public:
if (D->getKind() == Decl::TemplateTypeParm)
type->def.detailed_name = Intern(info->short_name);
else
SetName(D, info->short_name, info->qualified, type->def);
SetName(OrigD, info->short_name, info->qualified, type->def);
}
if (is_def || is_decl) {
const Decl *DC = cast<Decl>(SemDC);

View File

@ -272,6 +272,9 @@ CompletionItemKind GetCompletionKind(CodeCompletionContext::Kind K,
case Decl::TypeAlias:
case Decl::Typedef:
return CompletionItemKind::TypeParameter;
case Decl::Using:
case Decl::ConstructorUsingShadow:
return CompletionItemKind::Keyword;
case Decl::Binding:
return CompletionItemKind::Variable;
case Decl::Field: