summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script-beta/core/completion.lua15
-rw-r--r--script-beta/provider/provider.lua1
-rw-r--r--test-beta/completion/init.lua17
3 files changed, 26 insertions, 7 deletions
diff --git a/script-beta/core/completion.lua b/script-beta/core/completion.lua
index 4d0e855c..0b555e58 100644
--- a/script-beta/core/completion.lua
+++ b/script-beta/core/completion.lua
@@ -352,9 +352,10 @@ local function checkFieldThen(name, src, word, start, offset, parent, oop, resul
kind = ckind.Function
end
buildFunction(results, src, oop, {
- label = name,
- kind = kind,
- id = stack(function ()
+ label = name,
+ kind = kind,
+ deprecated = value.deprecated,
+ id = stack(function ()
return {
detail = buildDetail(src),
description = buildDesc(src),
@@ -382,11 +383,11 @@ local function checkFieldThen(name, src, word, start, offset, parent, oop, resul
textEdit, additionalTextEdits = checkFieldFromFieldToIndex(name, parent, word, start, offset)
end
results[#results+1] = {
- label = name,
- kind = kind,
- textEdit = textEdit,
+ label = name,
+ kind = kind,
+ textEdit = textEdit,
additionalTextEdits = additionalTextEdits,
- id = stack(function ()
+ id = stack(function ()
return {
detail = buildDetail(src),
description = buildDesc(src),
diff --git a/script-beta/provider/provider.lua b/script-beta/provider/provider.lua
index 71004c55..c747027c 100644
--- a/script-beta/provider/provider.lua
+++ b/script-beta/provider/provider.lua
@@ -360,6 +360,7 @@ proto.on('textDocument/completion', function (params)
local item = {
label = res.label,
kind = res.kind,
+ deprecated = res.deprecated,
sortText = ('%04d'):format(i),
insertText = res.insertText,
insertTextFormat = res.insertTextFormat,
diff --git a/test-beta/completion/init.lua b/test-beta/completion/init.lua
index 568937b1..7866ac11 100644
--- a/test-beta/completion/init.lua
+++ b/test-beta/completion/init.lua
@@ -38,6 +38,7 @@ local Cared = {
['kind'] = true,
['textEdit'] = true,
['additionalTextEdits'] = true,
+ ['deprecated'] = true,
}
function TEST(script)
@@ -1141,6 +1142,22 @@ io$
]]
(EXISTS)
+TEST [[
+debug.setcsta$
+]]
+{
+ {
+ label = 'setcstacklimit',
+ kind = CompletionItemKind.Function,
+ deprecated = true,
+ },
+ {
+ label = 'setcstacklimit()',
+ kind = CompletionItemKind.Snippet,
+ deprecated = true,
+ },
+}
+
do return end
TEST [[
---@$