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 @@ -174,6 +174,9 @@ export const scalaTmLanguage: TmLanguage = {
174
174
{
175
175
include : '#scala-symbol'
176
176
} ,
177
+ {
178
+ include : '#singleton-type'
179
+ } ,
177
180
{
178
181
include : '#scala-quoted'
179
182
} ,
@@ -431,6 +434,14 @@ export const scalaTmLanguage: TmLanguage = {
431
434
}
432
435
]
433
436
} ,
437
+ 'singleton-type' : {
438
+ match : `\\.(type)(?!${ idrest } |[0-9])` ,
439
+ captures : {
440
+ '1' : {
441
+ name : 'keyword.type.scala'
442
+ }
443
+ }
444
+ } ,
434
445
'scala-quoted' : {
435
446
match : "('\\{|'\\[)(?!')" ,
436
447
name : 'constant.other.quoted.scala'
@@ -494,7 +505,7 @@ export const scalaTmLanguage: TmLanguage = {
494
505
}
495
506
} ,
496
507
{
497
- match : `\\b(type)\\s+(${ backQuotedId } |${ plainid } )` ,
508
+ match : `(?<!\\.) \\b(type)\\s+(${ backQuotedId } |${ plainid } )` ,
498
509
captures : {
499
510
'1' : {
500
511
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