From 2f8afdbe937d78358bb93000ecae946aa258e270 Mon Sep 17 00:00:00 2001 From: Yingchi Long Date: Sat, 22 Jun 2024 11:10:54 +0800 Subject: [PATCH] use two `\n`s to make sure a new line is created in markdown --- nixd/lib/Controller/Hover.cpp | 2 +- nixd/tools/nixd/test/hover-options.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nixd/lib/Controller/Hover.cpp b/nixd/lib/Controller/Hover.cpp index 725acd438..64f5656fa 100644 --- a/nixd/lib/Controller/Hover.cpp +++ b/nixd/lib/Controller/Hover.cpp @@ -164,7 +164,7 @@ void Controller::onHover(const TextDocumentPositionParams &Params, Docs += "? (missing type)"; } if (Desc->Description) { - Docs += "\n" + Desc->Description.value_or(""); + Docs += "\n\n" + Desc->Description.value_or(""); } Reply(Hover{ .contents = diff --git a/nixd/tools/nixd/test/hover-options.md b/nixd/tools/nixd/test/hover-options.md index 35583a333..87e99ec00 100644 --- a/nixd/tools/nixd/test/hover-options.md +++ b/nixd/tools/nixd/test/hover-options.md @@ -64,7 +64,7 @@ CHECK-NEXT: "jsonrpc": "2.0", CHECK-NEXT: "result": { CHECK-NEXT: "contents": { CHECK-NEXT: "kind": "markdown", -CHECK-NEXT: "value": " (hello type)\ntest" +CHECK-NEXT: "value": " (hello type)\n\ntest" CHECK-NEXT: }, CHECK-NEXT: "range": { CHECK-NEXT: "end": {