Commit 310a90b
committed
fix: don't add extra newlines when there aren't extra sections in doc markdown
Currently if you have a simple scaladoc and you use `renderAsMarkdown`
(which Metals does) to render markdown for hovers, there are extra
newlines added that aren't necessary. Normally you can't tell as it
seems some editors just trim off the extra newlines, but you can see
in certain editors and in the REPL as well.
_Notice how it removes two lines_
```diff
scala> :doc CanEqual
Companion object containing a few universally known `CanEqual` instances.
CanEqual instances involving primitive types or the Null type are handled directly in
the compiler (see Implicits.synthesizedCanEqual), so they are not included here.
-
-
```
This just ensures that we add the extra two newlines only when we know
we have more sections coming.
fixes scalameta/metals#37401 parent b90752d commit 310a90b
1 file changed
+12
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
72 | 74 | | |
73 | | - | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| |||
0 commit comments