@@ -1492,6 +1492,34 @@ f({String? a, dynamic b}) {
1492
1492
await _initializeAndVerifyTokens (content, expected);
1493
1493
}
1494
1494
1495
+ Future <void > test_namedRecordFields_extension () async {
1496
+ var content = '''
1497
+ extension on ({int field,}) {
1498
+ get other => field + this.field;
1499
+ }
1500
+ ''' ;
1501
+
1502
+ var expected = [
1503
+ _Token ('extension' , SemanticTokenTypes .keyword),
1504
+ _Token ('on' , SemanticTokenTypes .keyword),
1505
+ _Token ('int' , SemanticTokenTypes .class_),
1506
+ _Token ('get' , SemanticTokenTypes .keyword),
1507
+ _Token ('other' , SemanticTokenTypes .property, [
1508
+ SemanticTokenModifiers .declaration,
1509
+ CustomSemanticTokenModifiers .instance,
1510
+ ]),
1511
+ _Token ('field' , SemanticTokenTypes .property, [
1512
+ CustomSemanticTokenModifiers .instance,
1513
+ ]),
1514
+ _Token ('this' , SemanticTokenTypes .keyword),
1515
+ _Token ('field' , SemanticTokenTypes .property, [
1516
+ CustomSemanticTokenModifiers .instance,
1517
+ ]),
1518
+ ];
1519
+
1520
+ await _initializeAndVerifyTokens (content, expected);
1521
+ }
1522
+
1495
1523
Future <void > test_never () async {
1496
1524
var content = '''
1497
1525
Never f() => throw '';
@@ -1847,6 +1875,34 @@ void f() {
1847
1875
await _initializeAndVerifyTokens (content, expected);
1848
1876
}
1849
1877
1878
+ Future <void > test_positionalRecordFields_extension () async {
1879
+ var content = r'''
1880
+ extension on (int field, double,) {
1881
+ get other => $1 + $2;
1882
+ }
1883
+ ''' ;
1884
+
1885
+ var expected = [
1886
+ _Token ('extension' , SemanticTokenTypes .keyword),
1887
+ _Token ('on' , SemanticTokenTypes .keyword),
1888
+ _Token ('int' , SemanticTokenTypes .class_),
1889
+ _Token ('double' , SemanticTokenTypes .class_),
1890
+ _Token ('get' , SemanticTokenTypes .keyword),
1891
+ _Token ('other' , SemanticTokenTypes .property, [
1892
+ SemanticTokenModifiers .declaration,
1893
+ CustomSemanticTokenModifiers .instance,
1894
+ ]),
1895
+ _Token (r'$1' , SemanticTokenTypes .property, [
1896
+ CustomSemanticTokenModifiers .instance,
1897
+ ]),
1898
+ _Token (r'$2' , SemanticTokenTypes .property, [
1899
+ CustomSemanticTokenModifiers .instance,
1900
+ ]),
1901
+ ];
1902
+
1903
+ await _initializeAndVerifyTokens (content, expected);
1904
+ }
1905
+
1850
1906
Future <void > test_range () async {
1851
1907
var content = '''
1852
1908
/// class docs
0 commit comments