mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-25 17:11:59 +00:00
Add missing GetCompletionKind branches
This commit is contained in:
parent
8e70a1078e
commit
56f57fc38e
@ -69,49 +69,58 @@ lsCompletionItemKind GetCompletionKind(CXCursorKind cursor_kind) {
|
|||||||
case CXCursor_UnexposedDecl:
|
case CXCursor_UnexposedDecl:
|
||||||
return lsCompletionItemKind::Text;
|
return lsCompletionItemKind::Text;
|
||||||
|
|
||||||
|
case CXCursor_StructDecl:
|
||||||
|
case CXCursor_UnionDecl:
|
||||||
|
return lsCompletionItemKind::Struct;
|
||||||
|
case CXCursor_ClassDecl:
|
||||||
|
return lsCompletionItemKind::Class;
|
||||||
|
case CXCursor_EnumDecl:
|
||||||
|
return lsCompletionItemKind::Enum;
|
||||||
|
case CXCursor_FieldDecl:
|
||||||
|
return lsCompletionItemKind::Field;
|
||||||
|
case CXCursor_EnumConstantDecl:
|
||||||
|
return lsCompletionItemKind::EnumMember;
|
||||||
|
case CXCursor_FunctionDecl:
|
||||||
|
return lsCompletionItemKind::Function;
|
||||||
|
case CXCursor_VarDecl:
|
||||||
|
case CXCursor_ParmDecl:
|
||||||
|
return lsCompletionItemKind::Variable;
|
||||||
|
case CXCursor_ObjCInterfaceDecl:
|
||||||
|
return lsCompletionItemKind::Interface;
|
||||||
|
|
||||||
case CXCursor_ObjCInstanceMethodDecl:
|
case CXCursor_ObjCInstanceMethodDecl:
|
||||||
case CXCursor_CXXMethod:
|
case CXCursor_CXXMethod:
|
||||||
case CXCursor_ObjCClassMethodDecl:
|
case CXCursor_ObjCClassMethodDecl:
|
||||||
return lsCompletionItemKind::Method;
|
return lsCompletionItemKind::Method;
|
||||||
|
|
||||||
case CXCursor_FunctionTemplate:
|
case CXCursor_FunctionTemplate:
|
||||||
case CXCursor_FunctionDecl:
|
return lsCompletionItemKind::Function;
|
||||||
return lsCompletionItemKind::Function;
|
|
||||||
|
|
||||||
case CXCursor_Constructor:
|
case CXCursor_Constructor:
|
||||||
case CXCursor_Destructor:
|
case CXCursor_Destructor:
|
||||||
case CXCursor_ConversionFunction:
|
case CXCursor_ConversionFunction:
|
||||||
return lsCompletionItemKind::Constructor;
|
return lsCompletionItemKind::Constructor;
|
||||||
|
|
||||||
case CXCursor_FieldDecl:
|
|
||||||
return lsCompletionItemKind::Field;
|
|
||||||
|
|
||||||
case CXCursor_VarDecl:
|
|
||||||
case CXCursor_ParmDecl:
|
|
||||||
case CXCursor_ObjCIvarDecl:
|
case CXCursor_ObjCIvarDecl:
|
||||||
return lsCompletionItemKind::Variable;
|
return lsCompletionItemKind::Variable;
|
||||||
|
|
||||||
case CXCursor_UnionDecl:
|
|
||||||
case CXCursor_ClassTemplate:
|
case CXCursor_ClassTemplate:
|
||||||
case CXCursor_ClassTemplatePartialSpecialization:
|
case CXCursor_ClassTemplatePartialSpecialization:
|
||||||
case CXCursor_ClassDecl:
|
|
||||||
case CXCursor_UsingDeclaration:
|
case CXCursor_UsingDeclaration:
|
||||||
case CXCursor_TypedefDecl:
|
case CXCursor_TypedefDecl:
|
||||||
case CXCursor_TypeAliasDecl:
|
case CXCursor_TypeAliasDecl:
|
||||||
case CXCursor_TypeAliasTemplateDecl:
|
case CXCursor_TypeAliasTemplateDecl:
|
||||||
case CXCursor_ObjCCategoryDecl:
|
case CXCursor_ObjCCategoryDecl:
|
||||||
case CXCursor_ObjCProtocolDecl:
|
case CXCursor_ObjCProtocolDecl:
|
||||||
case CXCursor_ObjCPropertyDecl:
|
|
||||||
case CXCursor_ObjCImplementationDecl:
|
case CXCursor_ObjCImplementationDecl:
|
||||||
case CXCursor_ObjCCategoryImplDecl:
|
case CXCursor_ObjCCategoryImplDecl:
|
||||||
return lsCompletionItemKind::Class;
|
return lsCompletionItemKind::Class;
|
||||||
|
|
||||||
case CXCursor_EnumDecl:
|
case CXCursor_ObjCPropertyDecl:
|
||||||
return lsCompletionItemKind::Enum;
|
return lsCompletionItemKind::Property;
|
||||||
|
|
||||||
case CXCursor_MacroInstantiation:
|
case CXCursor_MacroInstantiation:
|
||||||
case CXCursor_MacroDefinition:
|
case CXCursor_MacroDefinition:
|
||||||
case CXCursor_ObjCInterfaceDecl:
|
|
||||||
return lsCompletionItemKind::Interface;
|
return lsCompletionItemKind::Interface;
|
||||||
|
|
||||||
case CXCursor_Namespace:
|
case CXCursor_Namespace:
|
||||||
@ -126,7 +135,6 @@ lsCompletionItemKind GetCompletionKind(CXCursorKind cursor_kind) {
|
|||||||
case CXCursor_ObjCClassRef:
|
case CXCursor_ObjCClassRef:
|
||||||
return lsCompletionItemKind::Reference;
|
return lsCompletionItemKind::Reference;
|
||||||
|
|
||||||
// return lsCompletionItemKind::Property;
|
|
||||||
// return lsCompletionItemKind::Unit;
|
// return lsCompletionItemKind::Unit;
|
||||||
// return lsCompletionItemKind::Value;
|
// return lsCompletionItemKind::Value;
|
||||||
// return lsCompletionItemKind::Keyword;
|
// return lsCompletionItemKind::Keyword;
|
||||||
@ -138,11 +146,9 @@ lsCompletionItemKind GetCompletionKind(CXCursorKind cursor_kind) {
|
|||||||
case CXCursor_OverloadCandidate:
|
case CXCursor_OverloadCandidate:
|
||||||
return lsCompletionItemKind::Text;
|
return lsCompletionItemKind::Text;
|
||||||
|
|
||||||
case CXCursor_EnumConstantDecl:
|
case CXCursor_TemplateTypeParameter:
|
||||||
return lsCompletionItemKind::EnumMember;
|
case CXCursor_TemplateTemplateParameter:
|
||||||
|
return lsCompletionItemKind::TypeParameter;
|
||||||
case CXCursor_StructDecl:
|
|
||||||
return lsCompletionItemKind::Struct;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LOG_S(WARNING) << "Unhandled completion kind " << cursor_kind;
|
LOG_S(WARNING) << "Unhandled completion kind " << cursor_kind;
|
||||||
@ -165,48 +171,22 @@ void BuildCompletionItemTexts(std::vector<lsCompletionItem>& out,
|
|||||||
|
|
||||||
std::string text;
|
std::string text;
|
||||||
switch (kind) {
|
switch (kind) {
|
||||||
case CXCompletionChunk_LeftParen:
|
// clang-format off
|
||||||
text = '(';
|
case CXCompletionChunk_LeftParen: text = '('; break;
|
||||||
break;
|
case CXCompletionChunk_RightParen: text = ')'; break;
|
||||||
case CXCompletionChunk_RightParen:
|
case CXCompletionChunk_LeftBracket: text = '['; break;
|
||||||
text = ')';
|
case CXCompletionChunk_RightBracket: text = ']'; break;
|
||||||
break;
|
case CXCompletionChunk_LeftBrace: text = '{'; break;
|
||||||
case CXCompletionChunk_LeftBracket:
|
case CXCompletionChunk_RightBrace: text = '}'; break;
|
||||||
text = '[';
|
case CXCompletionChunk_LeftAngle: text = '<'; break;
|
||||||
break;
|
case CXCompletionChunk_RightAngle: text = '>'; break;
|
||||||
case CXCompletionChunk_RightBracket:
|
case CXCompletionChunk_Comma: text = ", "; break;
|
||||||
text = ']';
|
case CXCompletionChunk_Colon: text = ':'; break;
|
||||||
break;
|
case CXCompletionChunk_SemiColon: text = ';'; break;
|
||||||
case CXCompletionChunk_LeftBrace:
|
case CXCompletionChunk_Equal: text = '='; break;
|
||||||
text = '{';
|
case CXCompletionChunk_HorizontalSpace: text = ' '; break;
|
||||||
break;
|
case CXCompletionChunk_VerticalSpace: text = ' '; break;
|
||||||
case CXCompletionChunk_RightBrace:
|
// clang-format on
|
||||||
text = '}';
|
|
||||||
break;
|
|
||||||
case CXCompletionChunk_LeftAngle:
|
|
||||||
text = '<';
|
|
||||||
break;
|
|
||||||
case CXCompletionChunk_RightAngle:
|
|
||||||
text = '>';
|
|
||||||
break;
|
|
||||||
case CXCompletionChunk_Comma:
|
|
||||||
text = ", ";
|
|
||||||
break;
|
|
||||||
case CXCompletionChunk_Colon:
|
|
||||||
text = ':';
|
|
||||||
break;
|
|
||||||
case CXCompletionChunk_SemiColon:
|
|
||||||
text = ';';
|
|
||||||
break;
|
|
||||||
case CXCompletionChunk_Equal:
|
|
||||||
text = '=';
|
|
||||||
break;
|
|
||||||
case CXCompletionChunk_HorizontalSpace:
|
|
||||||
text = ' ';
|
|
||||||
break;
|
|
||||||
case CXCompletionChunk_VerticalSpace:
|
|
||||||
text = ' ';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CXCompletionChunk_ResultType:
|
case CXCompletionChunk_ResultType:
|
||||||
result_type =
|
result_type =
|
||||||
|
Loading…
Reference in New Issue
Block a user