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 {
5353 val start = scanner.offset
5454 val token = scanner.token
5555 val name = scanner.name
56+ val isSoftModifier = scanner.isSoftModifierInModifierPosition
5657 scanner.nextToken()
5758 val end = scanner.lastOffset
5859
@@ -67,10 +68,7 @@ object SyntaxHighlighting {
6768 // we don't highlight it, hence the `-1`
6869 highlightRange(start, end - 1 , LiteralColor )
6970
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 =>
7472 highlightRange(start, end, KeywordColor )
7573
7674 case IDENTIFIER if name == nme.??? =>
Original file line number Diff line number Diff line change @@ -125,5 +125,8 @@ class SyntaxHighlightingTests extends DottyTest {
125125 test(" inline def foo = 1" , " <K|inline> <K|def> <V|foo> = <L|1>" )
126126 test(" @inline def foo = 1" , " <T|@inline> <K|def> <V|foo> = <L|1>" )
127127 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>" )
128131 }
129132}
You can’t perform that action at this time.
0 commit comments