Add a divider between the element description and docs in hovers

Change-Id: I08dc275fd343dc7eaa0f0c6033b8889882889cd2
Reviewed-on: https://dart-review.googlesource.com/c/87406
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Danny Tuppeny <dantup@google.com>
This commit is contained in:
Danny Tuppeny 2018-12-17 14:58:20 +00:00 committed by commit-bot@chromium.org
parent 54d1118a66
commit c7e8a37cf3
2 changed files with 6 additions and 2 deletions

View file

@ -43,6 +43,7 @@ class HoverHandler extends MessageHandler<TextDocumentPositionParams, Hover> {
}
final content = new StringBuffer();
const divider = '---';
// Description.
if (hover.elementDescription != null) {
@ -50,7 +51,7 @@ class HoverHandler extends MessageHandler<TextDocumentPositionParams, Hover> {
if (hover.isDeprecated) {
content.write('(deprecated) ');
}
content..writeln(hover.elementDescription)..writeln('```')..writeln();
content..writeln(hover.elementDescription)..writeln('```');
}
// Source library.
@ -66,6 +67,9 @@ class HoverHandler extends MessageHandler<TextDocumentPositionParams, Hover> {
// Doc comments.
if (hover.dartdoc != null) {
if (content.length != 0) {
content.writeln(divider);
}
content.writeln(cleanDartdoc(hover.dartdoc));
}

View file

@ -46,7 +46,7 @@ class HoverTest extends AbstractLspAnalysisServerTest {
```dart
String abc
```
---
This is a string.
With some [refs] and some