Skip to content

Commit 524a1e9

Browse files
committed
IDE: Show type info and then doc in hover
Otherwise, we only see the docs at first glance when the docstring is long, and we need to scroll to get to the type info (which is generally a single line).
1 parent 8939d2d commit 524a1e9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

language-server/src/dotty/tools/languageserver/DottyLanguageServer.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ object DottyLanguageServer {
474474
val typeInfoHover = new lsp4j.MarkedString()
475475
typeInfoHover.setValue(typeInfo)
476476

477-
docHover.toList :+ typeInfoHover
477+
typeInfoHover :: docHover.toList
478478
}
479479

480480

language-server/test/dotty/tools/languageserver/HoverTest.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class HoverTest {
1212
@Test def hoverOnClassShowsDoc: Unit = {
1313
code"""$m1 /** foo */ ${m2}class Foo $m3 $m4""".withSource
1414
.hover(m1 to m2, Nil)
15-
.hover(m2 to m3, List("/** foo */", "Foo"))
15+
.hover(m2 to m3, List("Foo", "/** foo */"))
1616
.hover(m3 to m4, Nil)
1717
}
1818

0 commit comments

Comments
 (0)