File tree Expand file tree Collapse file tree 3 files changed +71
-0
lines changed Expand file tree Collapse file tree 3 files changed +71
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,9 @@ export const scalaTmLanguage: TmLanguage = {
150
150
{
151
151
include : '#inheritance'
152
152
} ,
153
+ {
154
+ include : '#extension'
155
+ } ,
153
156
{
154
157
include : '#imports'
155
158
} ,
@@ -859,6 +862,32 @@ export const scalaTmLanguage: TmLanguage = {
859
862
}
860
863
]
861
864
} ,
865
+ extension : {
866
+ patterns : [
867
+ {
868
+ match : `(extension)\\s+(?:(${ plainid } )\\s)?\\s*(on|(?=\\{))` ,
869
+ captures : {
870
+ '1' : {
871
+ name : 'keyword.declaration.scala'
872
+ } ,
873
+ '2' : {
874
+ name : 'entity.name.class'
875
+ } ,
876
+ '3' : {
877
+ name : 'keyword.declaration.scala'
878
+ }
879
+ }
880
+ } ,
881
+ {
882
+ match : `(extension)\\s+(?=[\\[\\(])` ,
883
+ captures : {
884
+ '1' : {
885
+ name : 'keyword.declaration.scala'
886
+ } ,
887
+ }
888
+ }
889
+ ]
890
+ } ,
862
891
'parameter-list' : {
863
892
patterns : [
864
893
{
Original file line number Diff line number Diff line change
1
+ // SYNTAX TEST "source.scala"
2
+
3
+ extension on (x : Rational ):
4
+ // ^^^^^^^^^ keyword.declaration.scala
5
+ // ^^ keyword.declaration.scala
6
+ // ^ variable.parameter.scala
7
+ // ^^^^^^^^ entity.name.class
8
+ def > (y : Rational ): Boolean = y < x
9
+
10
+ extension Ops on (x : Rational ):
11
+ // ^^^^^^^^^ keyword.declaration.scala
12
+ // ^^^ entity.name.class
13
+ // ^^ keyword.declaration.scala
14
+ // ^ variable.parameter.scala
15
+ // ^^^^^^^^ entity.name.class
16
+ def > (y : Rational ): Boolean = y < x
17
+
18
+ extension stringOps { }
19
+ // ^^^^^^^^^ keyword.declaration.scala
20
+ // ^^^^^^^^^ entity.name.class
21
+
22
+ extension { }
23
+ // ^^^^^^^^^ keyword.declaration.scala
Original file line number Diff line number Diff line change
1
+ // SYNTAX TEST "source.scala"
2
+
3
+ extension (x : T ) def combine (y : T ): T
4
+ // ^^^^^^^^^ keyword.declaration.scala
5
+ // ^ variable.parameter.scala
6
+ // ^ meta.colon.scala
7
+ // ^ entity.name.class
8
+ // ^^^ keyword.declaration.scala
9
+ // ^^^^^^^ entity.name.function.declaration
10
+
11
+
12
+ extension [T ](x : T ) def combine (y : T ): T
13
+ // ^^^^^^^^^ keyword.declaration.scala
14
+ // ^ entity.name.class
15
+ // ^ variable.parameter.scala
16
+ // ^ meta.colon.scala
17
+ // ^ entity.name.class
18
+ // ^^^ keyword.declaration.scala
19
+ // ^^^^^^^ entity.name.function.declaration
You can’t perform that action at this time.
0 commit comments