File tree 3 files changed +26
-4
lines changed
3 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -577,18 +577,18 @@ export const scalaTmLanguage: TmLanguage = {
577
577
inline : {
578
578
patterns : [
579
579
{
580
- match : `\\b(inline)\\b(?=(\\s+(?: ${ plainid } | ${ backQuotedId } )\\s*:)|(.*( val|def) ))` ,
580
+ match : `\\b(inline)\\b(?=(?:.(?! val|def|given))*(if|match ))` ,
581
581
captures : {
582
582
'1' : {
583
- name : 'storage.modifier.other '
583
+ name : 'keyword.control.flow.scala '
584
584
}
585
585
}
586
586
} ,
587
587
{
588
- match : `\\b(inline)\\b (?=.*(if|match ))` ,
588
+ match : `\\b(inline)\\s+ (?=(([\\w\\s]*(val|def|given))|( ${ plainid } | ${ backQuotedId } )\\s*: ))` ,
589
589
captures : {
590
590
'1' : {
591
- name : 'keyword.control.flow.scala '
591
+ name : 'storage.modifier.other '
592
592
}
593
593
}
594
594
}
Original file line number Diff line number Diff line change @@ -39,3 +39,15 @@ val x = inline[T]
39
39
// ^^^^^^ entity.name.function.declaration
40
40
// ^^^^^^ storage.modifier.other
41
41
// ^^^^^^ variable.parameter.scala
42
+
43
+ inline if (n == 0 ) 1 else 2 ; val x = 2
44
+ // ^^^^^^ keyword.control.flow.scala
45
+ // ^^ keyword.control.flow.scala
46
+
47
+ inline if (n == 0 ) 1 else 2 ; def x = 2
48
+ // ^^^^^^ keyword.control.flow.scala
49
+ // ^^ keyword.control.flow.scala
50
+
51
+ inline f[X ](x : X ) match {
52
+ // ^^^^^^ keyword.control.flow.scala
53
+ // ^^^^^ keyword.control.flow.scala
Original file line number Diff line number Diff line change
1
+ // SYNTAX TEST "source.scala"
2
+
3
+
4
+ inline def mkDefaultTypeable [T ]: Typeable [T ] = $ { TypeableMacros .impl[T ] }
5
+ // ^^^^^^ storage.modifier.other
6
+ // ^^^ keyword.declaration.scala
7
+
8
+ inline given [T ] as Typeable [T ] = mkDefaultTypeable[T ]
9
+ // ^^^^^^ storage.modifier.other
10
+ // ^^^^^ keyword.declaration.scala
You can’t perform that action at this time.
0 commit comments