Skip to content

Commit f99ee40

Browse files
committed
IDE: Show markdown titles in hover
1 parent 6eb26d6 commit f99ee40

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

compiler/src/dotty/tools/dotc/util/ParsedComment.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class ParsedComment(val comment: Comment) {
4848
/**
4949
* Renders this comment as markdown.
5050
*
51-
* The different sections are formatted according to the maping in `knownTags`.
51+
* The different sections are formatted according to the mapping in `knownTags`.
5252
*/
5353
def renderAsMarkdown: String = {
5454
val buf = new StringBuilder
@@ -193,7 +193,7 @@ object ParsedComment {
193193
case Nil =>
194194
None
195195
case items =>
196-
Some(s"""$title:
196+
Some(s"""#### $title:
197197
|${fn(items)}
198198
|""".stripMargin)
199199
}

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,45 +129,45 @@ class HoverTest {
129129
hoverContent("[T, U](fizz: Int, buzz: String)(implicit ev: Boolean): Any",
130130
"""Does something
131131
|
132-
|Type Parameters:
132+
|#### Type Parameters:
133133
| - **T** A first type param
134134
| - **U** Another type param
135135
|
136-
|Parameters:
136+
|#### Parameters:
137137
| - **fizz** Again another number
138138
| - **buzz** A String
139139
| - **ev** An implicit boolean
140140
|
141-
|Returns:
141+
|#### Returns:
142142
| - Something
143143
|
144-
|Throws:
144+
|#### Throws:
145145
| - **java.lang.NullPointerException** if you're unlucky
146146
| - **java.lang.InvalidArgumentException** if the argument is invalid
147147
|
148-
|See Also:
148+
|#### See Also:
149149
| - java.nio.file.Paths#get()
150150
|
151-
|Examples:
151+
|#### Examples:
152152
| - ```scala
153153
| myFoo.bar[Int, String](0, "hello, world")
154154
| ```
155155
|
156-
|Usecases:
156+
|#### Usecases:
157157
| - ```scala
158158
| def bar(fizz: Int, buzz: String): Any
159159
| ```
160160
|
161-
|Note:
161+
|#### Note:
162162
| - A note
163163
|
164-
|Authors:
164+
|#### Authors:
165165
| - John Doe
166166
|
167-
|Since:
167+
|#### Since:
168168
| - 0.1
169169
|
170-
|Version:
170+
|#### Version:
171171
| - 1.0""".stripMargin))
172172

173173
}

0 commit comments

Comments
 (0)