Skip to content

Commit

Permalink
Return markdown from getFunctionComment to temporarily preserve trail…
Browse files Browse the repository at this point in the history
…ing newlines
  • Loading branch information
sparr committed Oct 7, 2024
1 parent f6dcbcc commit 8a874ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased
<!-- Add all new changes here. They will be moved under a version at release -->
* `FIX` Fixed an issue preventing to set the locale to Japanese
* `FIX` Preserve newlines between function comment and @see

## 3.11.0
* `NEW` Added support for Japanese locale
Expand Down
11 changes: 3 additions & 8 deletions script/core/hover/description.lua
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ local function tryDocFieldComment(source)
end
end

local function getFunctionComment(source, raw)
local function getFunctionCommentMarkdown(source, raw)
local docGroup = source.bindDocs
if not docGroup then
return
Expand Down Expand Up @@ -393,11 +393,7 @@ local function getFunctionComment(source, raw)
local enums = getBindEnums(source, docGroup)
md:add('lua', enums)

local comment = md:string()
if comment == '' then
return nil
end
return comment
return md
end

---@async
Expand All @@ -407,8 +403,7 @@ local function tryDocComment(source, raw)
source = source.value
end
if source.type == 'function' then
local comment = getFunctionComment(source, raw)
md:add('md', comment)
md:add('md', getFunctionCommentMarkdown(source, raw))
source = source.parent
end
local comment = lookUpDocComments(source)
Expand Down

0 comments on commit 8a874ed

Please sign in to comment.