Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions script/core/completion/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1349,11 +1349,23 @@ local function pushCallEnumsAndFuncs(defs)
}
end
if def.type == 'doc.type.function' then
local insertText = buildInsertDocFunction(def)
local description
if def.comment then
description = def.comment
else
local descText = insertText:gsub('%$%{%d+:([^}]+)%}', function (val)
return val
end):gsub('%$%{?%d+%}?', '')
description = markdown()
: add('lua', descText)
: string()
end
results[#results+1] = {
label = infer.viewDocFunction(def),
description = def.comment,
description = description,
kind = define.CompletionItemKind.Function,
insertText = buildInsertDocFunction(def),
insertText = insertText,
}
end
end
Expand Down
6 changes: 6 additions & 0 deletions test/completion/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1895,6 +1895,12 @@ f(<??>)
function (${1:x}, ${2:y})\
\t$0\
end",
description = "\z
```lua\
function (x, y)\
\t\
end\
```"
},
}

Expand Down