Commit d7a02686 authored by Marco Bubke's avatar Marco Bubke

Clang: Show Enumeration as Type

Change-Id: Icb3fbaad68802276faa4a2c50d18c2415e17d26b
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent 89d86931
......@@ -132,8 +132,8 @@ HighlightingType HighlightingInformation::referencedTypeKind(const Cursor &curso
case CXCursor_UnionDecl:
case CXCursor_TypedefDecl:
case CXCursor_TemplateTypeParameter:
case CXCursor_TypeAliasDecl: return HighlightingType::Type;
case CXCursor_EnumDecl: return HighlightingType::Enumeration;
case CXCursor_TypeAliasDecl:
case CXCursor_EnumDecl: return HighlightingType::Type;
default: return HighlightingType::Invalid;
}
......@@ -208,6 +208,7 @@ HighlightingType HighlightingInformation::identifierKind(const Cursor &cursor) c
case CXCursor_TypeAliasDecl:
case CXCursor_TypedefDecl:
case CXCursor_ClassTemplate:
case CXCursor_EnumDecl:
case CXCursor_CXXStaticCastExpr:
case CXCursor_CXXReinterpretCastExpr:
case CXCursor_ObjCCategoryDecl:
......@@ -220,7 +221,6 @@ HighlightingType HighlightingInformation::identifierKind(const Cursor &cursor) c
case CXCursor_ObjCSuperClassRef: return HighlightingType::Type;
case CXCursor_FunctionTemplate: return HighlightingType::Function;
case CXCursor_EnumConstantDecl: return HighlightingType::Enumeration;
case CXCursor_EnumDecl: return referencedTypeKind(cursor);
case CXCursor_PreprocessingDirective: return HighlightingType::Preprocessor;
case CXCursor_MacroExpansion: return HighlightingType::PreprocessorExpansion;
case CXCursor_MacroDefinition: return HighlightingType::PreprocessorDefinition;
......
......@@ -340,7 +340,7 @@ TEST_F(HighlightingInformations, Enumeration)
{
const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(118, 17));
ASSERT_THAT(infos[1], HasType(HighlightingType::Enumeration));
ASSERT_THAT(infos[1], HasType(HighlightingType::Type));
}
TEST_F(HighlightingInformations, Enumerator)
......@@ -354,7 +354,7 @@ TEST_F(HighlightingInformations, EnumerationReferenceDeclarationType)
{
const auto infos = translationUnit.highlightingInformationsInRange(sourceRange(125, 28));
ASSERT_THAT(infos[0], HasType(HighlightingType::Enumeration));
ASSERT_THAT(infos[0], HasType(HighlightingType::Type));
}
TEST_F(HighlightingInformations, EnumerationReferenceDeclarationVariable)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment