diff --git a/changelog.md b/changelog.md index 63b67e065..621a38ae9 100644 --- a/changelog.md +++ b/changelog.md @@ -3,6 +3,7 @@ ## Unreleased * `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 diff --git a/script/core/hover/description.lua b/script/core/hover/description.lua index 9fcc88aa4..368b311c9 100644 --- a/script/core/hover/description.lua +++ b/script/core/hover/description.lua @@ -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 @@ -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 @@ -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)