File tree Expand file tree Collapse file tree 2 files changed +21
-9
lines changed Expand file tree Collapse file tree 2 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -707,17 +707,11 @@ export const scalaTmLanguage: TmLanguage = {
707
707
name : 'meta.package.scala'
708
708
} ,
709
709
{
710
- match : `\\b(given)\\s+( as)\\s ` ,
710
+ match : `\\b(given)\\b\\s*(?:\\b( as)\\b|( ${ backQuotedId } |(?!//|/\\*) ${ plainid } )?) ` ,
711
711
captures : {
712
712
'1' : { name : 'keyword.declaration.scala' } ,
713
- '2' : { name : 'keyword.declaration.scala' }
714
- }
715
- } ,
716
- {
717
- match : `\\b(given)\\s+(${ backQuotedId } |${ plainid } )?` ,
718
- captures : {
719
- '1' : { name : 'keyword.declaration.scala' } ,
720
- '2' : { name : 'entity.name.declaration' }
713
+ '2' : { name : 'keyword.declaration.scala' } ,
714
+ '3' : { name : 'entity.name.declaration' }
721
715
}
722
716
}
723
717
]
Original file line number Diff line number Diff line change 67
67
// ^^^ constant.character.literal.scala
68
68
// ^^^^ keyword.control.flow.scala
69
69
// ^ constant.numeric.scala
70
+
71
+ given // this should be a comment
72
+ // ^^^^^ keyword.declaration.scala
73
+ // ^^ punctuation.definition.comment.scala
74
+ // ^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.scala
75
+ as Foo
76
+ // ^^ keyword.declaration.scala
77
+
78
+ given // this should be a comment
79
+ // ^^^^^ keyword.declaration.scala
80
+ // ^^ punctuation.definition.comment.scala
81
+ // ^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.scala
82
+
83
+ given /* this should be a comment */
84
+ // ^^^^^ keyword.declaration.scala
85
+ // ^^ punctuation.definition.comment.scala
86
+ // ^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.scala
87
+ // ^^ punctuation.definition.comment.scala
You can’t perform that action at this time.
0 commit comments