Skip to content

Commit 2550ffd

Browse files
authored
Merge pull request #2888 from sparr/dont_strip_function_comment_trailing_newlines
Return markdown from getFunctionComment to temporarily preserve trailing newlines
2 parents 5f37370 + d524e81 commit 2550ffd

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44
<!-- Add all new changes here. They will be moved under a version at release -->
55
* `FIX` Fixed an issue preventing to set the locale to Japanese
6+
* `FIX` Preserve newlines between function comment and @see
67
* `FIX` Accept storagePath option from client to resolve addon directory not found
78

89
## 3.11.0

script/core/hover/description.lua

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ local function tryDocFieldComment(source)
336336
end
337337
end
338338

339-
local function getFunctionComment(source, raw)
339+
local function getFunctionCommentMarkdown(source, raw)
340340
local docGroup = source.bindDocs
341341
if not docGroup then
342342
return
@@ -393,11 +393,7 @@ local function getFunctionComment(source, raw)
393393
local enums = getBindEnums(source, docGroup)
394394
md:add('lua', enums)
395395

396-
local comment = md:string()
397-
if comment == '' then
398-
return nil
399-
end
400-
return comment
396+
return md
401397
end
402398

403399
---@async
@@ -407,8 +403,7 @@ local function tryDocComment(source, raw)
407403
source = source.value
408404
end
409405
if source.type == 'function' then
410-
local comment = getFunctionComment(source, raw)
411-
md:add('md', comment)
406+
md:add('md', getFunctionCommentMarkdown(source, raw))
412407
source = source.parent
413408
end
414409
local comment = lookUpDocComments(source)

0 commit comments

Comments
 (0)