Skip to content

Commit 550be22

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 b3542f4 commit 550be22

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ object DottyLanguageServer {
476476
val typeInfoHover = new lsp4j.MarkedString()
477477
typeInfoHover.setValue(typeInfo)
478478

479-
docHover.toList :+ typeInfoHover
479+
typeInfoHover :: docHover.toList
480480
}
481481

482482

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

Lines changed: 1 addition & 1 deletion
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)