diff options
author | Clay Sweetser <Varriount@users.noreply.github.com> | 2023-12-29 19:15:20 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-29 19:15:20 -0500 |
commit | 449a151ec5214df6c567e27b6084db9e03a4aeaf (patch) | |
tree | 5934930dcaf8dd1117d7cf062f1130e9955ec363 /script/core | |
parent | f836d90eb629c22219cbcdff9bfcd7f45f1751f3 (diff) | |
download | lua-language-server-449a151ec5214df6c567e27b6084db9e03a4aeaf.zip |
Pad `return` type annotations when required.
Place a space between `---` and `@return` when generating documentation for a function on a line like `--- `. This mimics how `@param` documentation is generated.
Diffstat (limited to 'script/core')
-rw-r--r-- | script/core/completion/completion.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua index b7d4650c..acb3adbe 100644 --- a/script/core/completion/completion.lua +++ b/script/core/completion/completion.lua @@ -2192,7 +2192,8 @@ local function buildluaDocOfFunction(func, pad) end for _, rtn in ipairs(returns) do index = index + 1 - buf[#buf+1] = ('---@return ${%d:%s}'):format( + buf[#buf+1] = ('---%s@return ${%d:%s}'):format( + pad and ' ' or '', index, rtn ) |