File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 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 = {
174174 {
175175 include : '#scala-symbol'
176176 } ,
177+ {
178+ include : '#singleton-type'
179+ } ,
177180 {
178181 include : '#scala-quoted'
179182 } ,
@@ -431,6 +434,14 @@ export const scalaTmLanguage: TmLanguage = {
431434 }
432435 ]
433436 } ,
437+ 'singleton-type' : {
438+ match : `\\.(type)(?!${ idrest } |[0-9])` ,
439+ captures : {
440+ '1' : {
441+ name : 'keyword.type.scala'
442+ }
443+ }
444+ } ,
434445 'scala-quoted' : {
435446 match : "('\\{|'\\[)(?!')" ,
436447 name : 'constant.other.quoted.scala'
@@ -494,7 +505,7 @@ export const scalaTmLanguage: TmLanguage = {
494505 }
495506 } ,
496507 {
497- match : `\\b(type)\\s+(${ backQuotedId } |${ plainid } )` ,
508+ match : `(?<!\\.) \\b(type)\\s+(${ backQuotedId } |${ plainid } )` ,
498509 captures : {
499510 '1' : {
500511 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