Skip to content

Commit

Permalink
bugfix: Document highlight in self type
Browse files Browse the repository at this point in the history
  • Loading branch information
jkciesluk committed Jan 10, 2024
1 parent 1f3e9f2 commit 33ae25a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ abstract class PcCollector[T](
* val opt: Option[<<String>>] =
*/
case tpe: TypeTree if tpe.original != null =>
tpe.original.children.foldLeft(acc)(traverse(_, _))
traverse(acc, tpe.original)
/**
* Some type trees don't have symbols attached such as:
* type A = List[_ <: <<Iterable>>[Int]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1138,4 +1138,22 @@ class DocumentHighlightSuite extends BaseDocumentHighlightSuite {
|}""".stripMargin
)

check(
"self-type",
"""|trait Foo {
| self: <<An@@y>> =>
| def bar(): <<Any>>
|}
|""".stripMargin
)

check(
"self-type2",
"""|trait Foo {
| self: <<Any>> =>
| def bar(): <<An@@y>>
|}
|""".stripMargin
)

}

0 comments on commit 33ae25a

Please sign in to comment.