forked from qt-creator/qt-creator
Clang: Support anonymous types in tokens
Add extra data to Keyword tokens. Does not affect highlighting. Change-Id: I206499ea35ee4ece5fe442665c904090cf5d90fc Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -226,9 +226,6 @@ CPlusPlus::Icons::IconType iconTypeForToken(const ClangBackEnd::TokenInfoContain
|
||||
|
||||
ClangBackEnd::HighlightingType mainType = token.types.mainHighlightingType;
|
||||
|
||||
if (mainType == ClangBackEnd::HighlightingType::Keyword)
|
||||
return CPlusPlus::Icons::KeywordIconType;
|
||||
|
||||
if (mainType == ClangBackEnd::HighlightingType::QtProperty)
|
||||
return CPlusPlus::Icons::PropertyIconType;
|
||||
|
||||
@@ -240,7 +237,8 @@ CPlusPlus::Icons::IconType iconTypeForToken(const ClangBackEnd::TokenInfoContain
|
||||
if (mainType == ClangBackEnd::HighlightingType::Enumeration)
|
||||
return CPlusPlus::Icons::EnumeratorIconType;
|
||||
|
||||
if (mainType == ClangBackEnd::HighlightingType::Type) {
|
||||
if (mainType == ClangBackEnd::HighlightingType::Type
|
||||
|| mainType == ClangBackEnd::HighlightingType::Keyword) {
|
||||
const ClangBackEnd::MixinHighlightingTypes &types = token.types.mixinHighlightingTypes;
|
||||
if (types.contains(ClangBackEnd::HighlightingType::Enum))
|
||||
return CPlusPlus::Icons::EnumIconType;
|
||||
@@ -248,6 +246,10 @@ CPlusPlus::Icons::IconType iconTypeForToken(const ClangBackEnd::TokenInfoContain
|
||||
return CPlusPlus::Icons::StructIconType;
|
||||
if (types.contains(ClangBackEnd::HighlightingType::Namespace))
|
||||
return CPlusPlus::Icons::NamespaceIconType;
|
||||
if (types.contains(ClangBackEnd::HighlightingType::Class))
|
||||
return CPlusPlus::Icons::ClassIconType;
|
||||
if (mainType == ClangBackEnd::HighlightingType::Keyword)
|
||||
return CPlusPlus::Icons::KeywordIconType;
|
||||
return CPlusPlus::Icons::ClassIconType;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user