File tree 2 files changed +23
-1
lines changed
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,9 @@ export const scalaTmLanguage: TmLanguage = {
177
177
{
178
178
include : '#scala-symbol'
179
179
} ,
180
+ {
181
+ include : '#singleton-type'
182
+ } ,
180
183
{
181
184
include : '#scala-quoted'
182
185
} ,
@@ -434,6 +437,14 @@ export const scalaTmLanguage: TmLanguage = {
434
437
}
435
438
]
436
439
} ,
440
+ 'singleton-type' : {
441
+ match : `\\.(type)(?!${ idrest } |[0-9])` ,
442
+ captures : {
443
+ '1' : {
444
+ name : 'keyword.type.scala'
445
+ }
446
+ }
447
+ } ,
437
448
'scala-quoted' : {
438
449
match : "('\\{|'\\[)(?!')" ,
439
450
name : 'constant.other.quoted.scala'
@@ -497,7 +508,7 @@ export const scalaTmLanguage: TmLanguage = {
497
508
}
498
509
} ,
499
510
{
500
- match : `\\b(type)\\s+(${ backQuotedId } |${ plainid } )` ,
511
+ match : `(?<!\\.) \\b(type)\\s+(${ backQuotedId } |${ plainid } )` ,
501
512
captures : {
502
513
'1' : {
503
514
name : 'keyword.declaration.scala'
Original file line number Diff line number Diff line change
1
+ // SYNTAX TEST "source.scala"
2
+
3
+ val x = ???
4
+ trait Foo [T <: x.type ]
5
+ // ^^^^ keyword.type.scala
6
+
7
+ val a : x.type = ???
8
+ // ^^^^ keyword.type.scala
9
+
10
+ val b : Foo [x.type ] = ???
11
+ // ^^^^ keyword.type.scala
You can’t perform that action at this time.
0 commit comments