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 @@ -177,6 +177,9 @@ export const scalaTmLanguage: TmLanguage = {
177177 {
178178 include : '#scala-symbol'
179179 } ,
180+ {
181+ include : '#singleton-type'
182+ } ,
180183 {
181184 include : '#scala-quoted'
182185 } ,
@@ -434,6 +437,14 @@ export const scalaTmLanguage: TmLanguage = {
434437 }
435438 ]
436439 } ,
440+ 'singleton-type' : {
441+ match : `\\.(type)(?!${ idrest } |[0-9])` ,
442+ captures : {
443+ '1' : {
444+ name : 'keyword.type.scala'
445+ }
446+ }
447+ } ,
437448 'scala-quoted' : {
438449 match : "('\\{|'\\[)(?!')" ,
439450 name : 'constant.other.quoted.scala'
@@ -497,7 +508,7 @@ export const scalaTmLanguage: TmLanguage = {
497508 }
498509 } ,
499510 {
500- match : `\\b(type)\\s+(${ backQuotedId } |${ plainid } )` ,
511+ match : `(?<!\\.) \\b(type)\\s+(${ backQuotedId } |${ plainid } )` ,
501512 captures : {
502513 '1' : {
503514 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