diff --git a/clang-tools-extra/clangd/SemanticHighlighting.h b/clang-tools-extra/clangd/SemanticHighlighting.h --- a/clang-tools-extra/clangd/SemanticHighlighting.h +++ b/clang-tools-extra/clangd/SemanticHighlighting.h @@ -48,7 +48,7 @@ StaticField, Class, Enum, - EnumConstant, + EnumMember, Typedef, DependentType, DependentName, diff --git a/clang-tools-extra/clangd/SemanticHighlighting.cpp b/clang-tools-extra/clangd/SemanticHighlighting.cpp --- a/clang-tools-extra/clangd/SemanticHighlighting.cpp +++ b/clang-tools-extra/clangd/SemanticHighlighting.cpp @@ -82,7 +82,7 @@ if (isa(D)) return HighlightingKind::Enum; if (isa(D)) - return HighlightingKind::EnumConstant; + return HighlightingKind::EnumMember; if (isa(D)) return HighlightingKind::Parameter; if (auto *VD = dyn_cast(D)) @@ -427,8 +427,8 @@ return OS << "Class"; case HighlightingKind::Enum: return OS << "Enum"; - case HighlightingKind::EnumConstant: - return OS << "EnumConstant"; + case HighlightingKind::EnumMember: + return OS << "EnumMember"; case HighlightingKind::Typedef: return OS << "Typedef"; case HighlightingKind::DependentType: @@ -570,8 +570,8 @@ return "class"; case HighlightingKind::Enum: return "enum"; - case HighlightingKind::EnumConstant: - return "enumConstant"; // nonstandard + case HighlightingKind::EnumMember: + return "enumMember"; case HighlightingKind::Typedef: return "type"; case HighlightingKind::DependentType: @@ -647,7 +647,7 @@ return "entity.name.type.class.cpp"; case HighlightingKind::Enum: return "entity.name.type.enum.cpp"; - case HighlightingKind::EnumConstant: + case HighlightingKind::EnumMember: return "variable.other.enummember.cpp"; case HighlightingKind::Typedef: return "entity.name.type.typedef.cpp"; diff --git a/clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp b/clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp --- a/clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp +++ b/clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp @@ -51,7 +51,7 @@ {HighlightingKind::Class, "Class"}, {HighlightingKind::Enum, "Enum"}, {HighlightingKind::Namespace, "Namespace"}, - {HighlightingKind::EnumConstant, "EnumConstant"}, + {HighlightingKind::EnumMember, "EnumMember"}, {HighlightingKind::Field, "Field"}, {HighlightingKind::StaticField, "StaticField"}, {HighlightingKind::Method, "Method"}, @@ -212,18 +212,18 @@ )cpp", R"cpp( enum class $Enum[[E]] { - $EnumConstant[[A]], - $EnumConstant[[B]], + $EnumMember[[A]], + $EnumMember[[B]], }; enum $Enum[[EE]] { - $EnumConstant[[Hi]], + $EnumMember[[Hi]], }; struct $Class[[A]] { $Enum[[E]] $Field[[EEE]]; $Enum[[EE]] $Field[[EEEE]]; }; - int $Variable[[I]] = $EnumConstant[[Hi]]; - $Enum[[E]] $Variable[[L]] = $Enum[[E]]::$EnumConstant[[B]]; + int $Variable[[I]] = $EnumMember[[Hi]]; + $Enum[[E]] $Variable[[L]] = $Enum[[E]]::$EnumMember[[B]]; )cpp", R"cpp( namespace $Namespace[[abc]] { @@ -233,7 +233,7 @@ namespace $Namespace[[cde]] { struct $Class[[A]] { enum class $Enum[[B]] { - $EnumConstant[[Hi]], + $EnumMember[[Hi]], }; }; } @@ -244,7 +244,7 @@ $Namespace[[abc]]::$Namespace[[bcd]]::$Namespace[[cde]]; $Namespace[[abc]]::$Namespace[[bcd]]::$Class[[A]] $Variable[[AA]]; $Namespace[[vwz]]::$Class[[A]]::$Enum[[B]] $Variable[[AAA]] = - $Namespace[[vwz]]::$Class[[A]]::$Enum[[B]]::$EnumConstant[[Hi]]; + $Namespace[[vwz]]::$Class[[A]]::$Enum[[B]]::$EnumMember[[Hi]]; ::$Namespace[[vwz]]::$Class[[A]] $Variable[[B]]; ::$Namespace[[abc]]::$Namespace[[bcd]]::$Class[[A]] $Variable[[BB]]; )cpp", @@ -357,7 +357,7 @@ )cpp", R"cpp( enum $Enum[[En]] { - $EnumConstant[[EC]], + $EnumMember[[EC]], }; class $Class[[Foo]] {}; class $Class[[Bar]] { @@ -371,15 +371,15 @@ $Field[[I]] (123) {} }; class $Class[[Bar2]] : public $Class[[Bar]] { - $Class[[Bar2]]() : $Class[[Bar]]($Class[[Foo]](), $EnumConstant[[EC]]) {} + $Class[[Bar2]]() : $Class[[Bar]]($Class[[Foo]](), $EnumMember[[EC]]) {} }; )cpp", R"cpp( enum $Enum[[E]] { - $EnumConstant[[E]], + $EnumMember[[E]], }; class $Class[[Foo]] {}; - $Enum[[auto]] $Variable[[AE]] = $Enum[[E]]::$EnumConstant[[E]]; + $Enum[[auto]] $Variable[[AE]] = $Enum[[E]]::$EnumMember[[E]]; $Class[[auto]] $Variable[[AF]] = $Class[[Foo]](); $Class[[decltype]](auto) $Variable[[AF2]] = $Class[[Foo]](); $Class[[auto]] *$Variable[[AFP]] = &$Variable[[AF]];