File tree 2 files changed +38
-0
lines changed
src/dotty/tools/dotc/printing
test/dotty/tools/dotc/printing
2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -109,9 +109,11 @@ object SyntaxHighlighting {
109
109
case tree : ValOrDefDef =>
110
110
highlightAnnotations(tree)
111
111
highlightPosition(tree.nameSpan, ValDefColor )
112
+ highlightPosition(tree.endSpan, ValDefColor )
112
113
case tree : MemberDef /* ModuleDef | TypeDef */ =>
113
114
highlightAnnotations(tree)
114
115
highlightPosition(tree.nameSpan, TypeColor )
116
+ highlightPosition(tree.endSpan, TypeColor )
115
117
case tree : Ident if tree.isType =>
116
118
highlightPosition(tree.span, TypeColor )
117
119
case _ : TypeTree =>
Original file line number Diff line number Diff line change @@ -140,5 +140,41 @@ class SyntaxHighlightingTests extends DottyTest {
140
140
test(" val inline = 2" , " <K|val> <V|inline> = <L|2>" )
141
141
test(" def inline = 2" , " <K|def> <V|inline> = <L|2>" )
142
142
test(" def foo(inline: Int) = 2" , " <K|def> <V|foo>(<V|inline>: <T|Int>) = <L|2>" )
143
+ test(
144
+ """ enum Foo:
145
+ | case foo
146
+ |end Foo""" .stripMargin,
147
+ """ <K|enum> <T|Foo>:
148
+ | <K|case> <T|foo>
149
+ |<K|end> <T|Foo>""" .stripMargin
150
+ )
151
+ test(
152
+ """ class Foo:
153
+ |end Foo""" .stripMargin,
154
+ """ <K|class> <T|Foo>:
155
+ |<K|end> <T|Foo>""" .stripMargin
156
+ )
157
+ test(
158
+ """ object Foo:
159
+ |end Foo""" .stripMargin,
160
+ """ <K|object> <T|Foo>:
161
+ |<K|end> <T|Foo>""" .stripMargin
162
+ )
163
+ test(
164
+ """ def foo =
165
+ | ()
166
+ |end foo""" .stripMargin,
167
+ """ <K|def> <V|foo> =
168
+ | ()
169
+ |<K|end> <V|foo>""" .stripMargin
170
+ )
171
+ test(
172
+ """ val foo =
173
+ | ()
174
+ |end foo""" .stripMargin,
175
+ """ <K|val> <V|foo> =
176
+ | ()
177
+ |<K|end> <V|foo>""" .stripMargin
178
+ )
143
179
}
144
180
}
You can’t perform that action at this time.
0 commit comments