File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
src/dotty/tools/dotc/printing
test/dotty/tools/dotc/printing Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ object SyntaxHighlighting {
53
53
val start = scanner.offset
54
54
val token = scanner.token
55
55
val name = scanner.name
56
+ val isSoftModifier = scanner.isSoftModifierInModifierPosition
56
57
scanner.nextToken()
57
58
val end = scanner.lastOffset
58
59
@@ -67,10 +68,7 @@ object SyntaxHighlighting {
67
68
// we don't highlight it, hence the `-1`
68
69
highlightRange(start, end - 1 , LiteralColor )
69
70
70
- case _ if alphaKeywords.contains(token) =>
71
- highlightRange(start, end, KeywordColor )
72
-
73
- case IDENTIFIER if scanner.isSoftModifierInModifierPosition =>
71
+ case _ if alphaKeywords.contains(token) || isSoftModifier =>
74
72
highlightRange(start, end, KeywordColor )
75
73
76
74
case IDENTIFIER if name == nme.??? =>
Original file line number Diff line number Diff line change @@ -125,5 +125,8 @@ class SyntaxHighlightingTests extends DottyTest {
125
125
test(" inline def foo = 1" , " <K|inline> <K|def> <V|foo> = <L|1>" )
126
126
test(" @inline def foo = 1" , " <T|@inline> <K|def> <V|foo> = <L|1>" )
127
127
test(" class inline" , " <K|class> <T|inline>" )
128
+ test(" val inline = 2" , " <K|val> <V|inline> = <L|2>" )
129
+ test(" def inline = 2" , " <K|def> <V|inline> = <L|2>" )
130
+ test(" def foo(inline: Int) = 2" , " <K|def> <V|foo>(<V|inline>: <T|Int>) = <L|2>" )
128
131
}
129
132
}
You can’t perform that action at this time.
0 commit comments