diff --git a/pkg/analysis_server/doc/api.html b/pkg/analysis_server/doc/api.html
index 3bea13f57c6..338d07b6144 100644
--- a/pkg/analysis_server/doc/api.html
+++ b/pkg/analysis_server/doc/api.html
@@ -4791,7 +4791,7 @@ a:focus, a:hover {
METHOD_STATIC
Deprecated - no longer sent.
- PARAMETER
+ MIXINPARAMETER
Deprecated - no longer sent.
SETTER_DECLARATION
diff --git a/pkg/analysis_server/lib/src/computer/computer_highlights.dart b/pkg/analysis_server/lib/src/computer/computer_highlights.dart
index 084f22e3513..465839e7f92 100644
--- a/pkg/analysis_server/lib/src/computer/computer_highlights.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_highlights.dart
@@ -1146,6 +1146,7 @@ class _DartUnitHighlightsComputerVisitor extends RecursiveAstVisitor {
void visitMixinDeclaration(MixinDeclaration node) {
computer._addRegion_token(node.baseKeyword, HighlightRegionType.BUILT_IN);
computer._addRegion_token(node.mixinKeyword, HighlightRegionType.BUILT_IN);
+ computer._addRegion_token(node.name, HighlightRegionType.MIXIN);
super.visitMixinDeclaration(node);
}
diff --git a/pkg/analysis_server/test/analysis/notification_highlights2_test.dart b/pkg/analysis_server/test/analysis/notification_highlights2_test.dart
index f42b259185c..88f1a456b25 100644
--- a/pkg/analysis_server/test/analysis/notification_highlights2_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_highlights2_test.dart
@@ -1433,14 +1433,6 @@ class C {
assertHasRegion(HighlightRegionType.KEYWORD, 'late');
}
- Future test_KEYWORD_mixin() async {
- addTestFile('''
-mixin M {}
-''');
- await prepareHighlights();
- assertHasRegion(HighlightRegionType.BUILT_IN, 'mixin');
- }
-
Future test_KEYWORD_required() async {
addTestFile('''
void f({required int x}) {}
@@ -1590,6 +1582,33 @@ void f(p) {
assertHasRegion(HighlightRegionType.INSTANCE_METHOD_REFERENCE, 'add(null)');
}
+ Future test_mixin() async {
+ var testCode = TestCode.parse(r'''
+mixin M on int {}
+''');
+ addTestFile(testCode.code);
+ await prepareHighlights();
+ assertHighlightText(testCode, -1, r'''
+0 + 5 |mixin| BUILT_IN
+6 + 1 |M| MIXIN
+8 + 2 |on| BUILT_IN
+11 + 3 |int| CLASS
+''');
+ }
+
+ Future test_mixin_base() async {
+ var testCode = TestCode.parse(r'''
+base mixin M {}
+''');
+ addTestFile(testCode.code);
+ await prepareHighlights();
+ assertHighlightText(testCode, -1, r'''
+0 + 4 |base| BUILT_IN
+5 + 5 |mixin| BUILT_IN
+11 + 1 |M| MIXIN
+''');
+ }
+
Future test_namedExpression_namedParameter() async {
addTestFile('''
void f({int a}) {}
diff --git a/pkg/analysis_server/test/integration/support/protocol_matchers.dart b/pkg/analysis_server/test/integration/support/protocol_matchers.dart
index d9f6da6768e..9c9c12d8b1e 100644
--- a/pkg/analysis_server/test/integration/support/protocol_matchers.dart
+++ b/pkg/analysis_server/test/integration/support/protocol_matchers.dart
@@ -843,6 +843,7 @@ final Matcher isHighlightRegion = LazyMatcher(() => MatchesJsonObject(
/// METHOD_DECLARATION
/// METHOD_DECLARATION_STATIC
/// METHOD_STATIC
+/// MIXIN
/// PARAMETER
/// SETTER_DECLARATION
/// TOP_LEVEL_VARIABLE
@@ -926,6 +927,7 @@ final Matcher isHighlightRegionType = MatchesEnum('HighlightRegionType', [
'METHOD_DECLARATION',
'METHOD_DECLARATION_STATIC',
'METHOD_STATIC',
+ 'MIXIN',
'PARAMETER',
'SETTER_DECLARATION',
'TOP_LEVEL_VARIABLE',
diff --git a/pkg/analysis_server/tool/spec/generated/java/types/HighlightRegionType.java b/pkg/analysis_server/tool/spec/generated/java/types/HighlightRegionType.java
index d6ab3ef3b55..56cdb49c97f 100644
--- a/pkg/analysis_server/tool/spec/generated/java/types/HighlightRegionType.java
+++ b/pkg/analysis_server/tool/spec/generated/java/types/HighlightRegionType.java
@@ -158,6 +158,8 @@ public class HighlightRegionType {
*/
public static final String METHOD_STATIC = "METHOD_STATIC";
+ public static final String MIXIN = "MIXIN";
+
/**
* Deprecated - no longer sent.
*/
diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart
index 01225fef6cd..877607aa55e 100644
--- a/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart
+++ b/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart
@@ -1935,6 +1935,7 @@ class HighlightRegion implements HasToJson {
/// METHOD_DECLARATION
/// METHOD_DECLARATION_STATIC
/// METHOD_STATIC
+/// MIXIN
/// PARAMETER
/// SETTER_DECLARATION
/// TOP_LEVEL_VARIABLE
@@ -2133,6 +2134,8 @@ class HighlightRegionType implements Enum {
static const HighlightRegionType METHOD_STATIC =
HighlightRegionType._('METHOD_STATIC');
+ static const HighlightRegionType MIXIN = HighlightRegionType._('MIXIN');
+
/// Deprecated - no longer sent.
static const HighlightRegionType PARAMETER =
HighlightRegionType._('PARAMETER');
@@ -2271,6 +2274,7 @@ class HighlightRegionType implements Enum {
METHOD_DECLARATION,
METHOD_DECLARATION_STATIC,
METHOD_STATIC,
+ MIXIN,
PARAMETER,
SETTER_DECLARATION,
TOP_LEVEL_VARIABLE,
@@ -2416,6 +2420,8 @@ class HighlightRegionType implements Enum {
return METHOD_DECLARATION_STATIC;
case 'METHOD_STATIC':
return METHOD_STATIC;
+ case 'MIXIN':
+ return MIXIN;
case 'PARAMETER':
return PARAMETER;
case 'SETTER_DECLARATION':
diff --git a/pkg/analyzer_plugin/doc/api.html b/pkg/analyzer_plugin/doc/api.html
index 82bc04611c6..e2d7a05785c 100644
--- a/pkg/analyzer_plugin/doc/api.html
+++ b/pkg/analyzer_plugin/doc/api.html
@@ -1449,7 +1449,7 @@ a:focus, a:hover {
METHOD_STATIC
Deprecated - no longer sent.
- PARAMETER
+ MIXINPARAMETER
Deprecated - no longer sent.
SETTER_DECLARATION
diff --git a/pkg/analyzer_plugin/lib/protocol/protocol_common.dart b/pkg/analyzer_plugin/lib/protocol/protocol_common.dart
index 7f6bb07134a..4987b67ec1f 100644
--- a/pkg/analyzer_plugin/lib/protocol/protocol_common.dart
+++ b/pkg/analyzer_plugin/lib/protocol/protocol_common.dart
@@ -1935,6 +1935,7 @@ class HighlightRegion implements HasToJson {
/// METHOD_DECLARATION
/// METHOD_DECLARATION_STATIC
/// METHOD_STATIC
+/// MIXIN
/// PARAMETER
/// SETTER_DECLARATION
/// TOP_LEVEL_VARIABLE
@@ -2133,6 +2134,8 @@ class HighlightRegionType implements Enum {
static const HighlightRegionType METHOD_STATIC =
HighlightRegionType._('METHOD_STATIC');
+ static const HighlightRegionType MIXIN = HighlightRegionType._('MIXIN');
+
/// Deprecated - no longer sent.
static const HighlightRegionType PARAMETER =
HighlightRegionType._('PARAMETER');
@@ -2271,6 +2274,7 @@ class HighlightRegionType implements Enum {
METHOD_DECLARATION,
METHOD_DECLARATION_STATIC,
METHOD_STATIC,
+ MIXIN,
PARAMETER,
SETTER_DECLARATION,
TOP_LEVEL_VARIABLE,
@@ -2416,6 +2420,8 @@ class HighlightRegionType implements Enum {
return METHOD_DECLARATION_STATIC;
case 'METHOD_STATIC':
return METHOD_STATIC;
+ case 'MIXIN':
+ return MIXIN;
case 'PARAMETER':
return PARAMETER;
case 'SETTER_DECLARATION':
diff --git a/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart b/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart
index 9bae54efcb8..1d38dbd229b 100644
--- a/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart
+++ b/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart
@@ -420,6 +420,7 @@ final Matcher isHighlightRegion = LazyMatcher(() => MatchesJsonObject(
/// METHOD_DECLARATION
/// METHOD_DECLARATION_STATIC
/// METHOD_STATIC
+/// MIXIN
/// PARAMETER
/// SETTER_DECLARATION
/// TOP_LEVEL_VARIABLE
@@ -503,6 +504,7 @@ final Matcher isHighlightRegionType = MatchesEnum('HighlightRegionType', [
'METHOD_DECLARATION',
'METHOD_DECLARATION_STATIC',
'METHOD_STATIC',
+ 'MIXIN',
'PARAMETER',
'SETTER_DECLARATION',
'TOP_LEVEL_VARIABLE',
diff --git a/pkg/analyzer_plugin/tool/spec/common_types_spec.html b/pkg/analyzer_plugin/tool/spec/common_types_spec.html
index ef7bc5fbf11..e570bc46233 100644
--- a/pkg/analyzer_plugin/tool/spec/common_types_spec.html
+++ b/pkg/analyzer_plugin/tool/spec/common_types_spec.html
@@ -834,6 +834,7 @@
METHOD_STATIC
Deprecated - no longer sent.
+ MIXIN
PARAMETER
Deprecated - no longer sent.