File tree 2 files changed +9
-1
lines changed
src/dotty/tools/dotc/printing
test/dotty/tools/dotc/printing
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,10 @@ object SyntaxHighlighting {
107
107
case tree : ValOrDefDef =>
108
108
highlightAnnotations(tree)
109
109
highlightPosition(tree.nameSpan, ValDefColor )
110
+ // Special case these to only highlight the actual types and not
111
+ // the braces
112
+ case tree : LambdaTypeTree =>
113
+ tree.tparams.foreach(tparam => highlightPosition(tparam.span, TypeColor ))
110
114
case tree : MemberDef /* ModuleDef | TypeDef */ =>
111
115
highlightAnnotations(tree)
112
116
highlightPosition(tree.nameSpan, TypeColor )
Original file line number Diff line number Diff line change @@ -23,7 +23,9 @@ class SyntaxHighlightingTests extends DottyTest {
23
23
24
24
if (expected != highlighted) {
25
25
// assertEquals produces weird expected/found message
26
- fail(s " expected: $expected but was: $highlighted" )
26
+ fail(s """ |
27
+ |expected: $expected
28
+ |highlighted: $highlighted""" .stripMargin)
27
29
}
28
30
}
29
31
@@ -41,6 +43,8 @@ class SyntaxHighlightingTests extends DottyTest {
41
43
test(" type Foo = Int" , " <K|type> <T|Foo> = <T|Int>" )
42
44
test(" type A = String | Int" , " <K|type> <T|A> = <T|String> <T||> <T|Int>" )
43
45
test(" type B = String & Int" , " <K|type> <T|B> = <T|String> <T|&> <T|Int>" )
46
+ test(" type Id[A] = A" , " <K|type> <T|Id>[<T|A>] = <T|A>" )
47
+ test(" type Foo = [X] =>> List[X]" , " <K|type> <T|Foo> = [<T|X>] =>> <T|List[X]>" )
44
48
}
45
49
46
50
@ Test
You can’t perform that action at this time.
0 commit comments