From fb6203012290985ff2e510cbb0cf1fa90258658f Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Sat, 23 Feb 2013 17:34:10 -0800 Subject: [PATCH] A few more clang cursorkinds supported Now C-family completion will have fewer compeletion strings labeled as 'u' kind. --- cpp/ycm/ClangCompleter/CompletionData.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/cpp/ycm/ClangCompleter/CompletionData.cpp b/cpp/ycm/ClangCompleter/CompletionData.cpp index ac6a87ef..ae66f4fb 100644 --- a/cpp/ycm/ClangCompleter/CompletionData.cpp +++ b/cpp/ycm/ClangCompleter/CompletionData.cpp @@ -24,14 +24,19 @@ namespace { char CursorKindToVimKind( CXCursorKind kind ) { - // TODO: actually it appears that Vim will show returned kinds even when they - // do not match the "approved" list, so let's use that switch ( kind ) { - case CXCursor_UnexposedDecl: case CXCursor_StructDecl: - case CXCursor_UnionDecl: + return 's'; + case CXCursor_ClassDecl: + case CXCursor_ClassTemplate: + return 'c'; + case CXCursor_EnumDecl: + return 'e'; + + case CXCursor_UnexposedDecl: + case CXCursor_UnionDecl: case CXCursor_TypedefDecl: return 't'; @@ -41,6 +46,9 @@ char CursorKindToVimKind( CXCursorKind kind ) { case CXCursor_FunctionDecl: case CXCursor_CXXMethod: case CXCursor_FunctionTemplate: + case CXCursor_ConversionFunction: + case CXCursor_Constructor: + case CXCursor_Destructor: return 'f'; case CXCursor_VarDecl: @@ -49,6 +57,13 @@ char CursorKindToVimKind( CXCursorKind kind ) { case CXCursor_MacroDefinition: return 'd'; + case CXCursor_ParmDecl: + return 'p'; + + case CXCursor_Namespace: + case CXCursor_NamespaceAlias: + return 'n'; + default: return 'u'; // for 'unknown', 'unsupported'... whatever you like }