diff options
-rw-r--r-- | script/core/completion/completion.lua | 4 | ||||
-rw-r--r-- | test/completion/common.lua | 23 |
2 files changed, 26 insertions, 1 deletions
diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua index d751b727..87542422 100644 --- a/script/core/completion/completion.lua +++ b/script/core/completion/completion.lua @@ -243,7 +243,9 @@ local function buildFunction(results, source, value, oop, data) if snipType == 'Both' or snipType == 'Replace' then local snipData = util.deepCopy(data) - snipData.kind = define.CompletionItemKind.Snippet + snipData.kind = snipType == 'Both' + and define.CompletionItemKind.Snippet + or data.kind snipData.insertText = buildFunctionSnip(source, value, oop) snipData.insertTextFormat = 2 snipData.command = { diff --git a/test/completion/common.lua b/test/completion/common.lua index fa261a5f..6543e5f6 100644 --- a/test/completion/common.lua +++ b/test/completion/common.lua @@ -76,6 +76,29 @@ zac<??> }, } +config.set(nil, 'Lua.completion.callSnippet', 'Disable') +TEST [[ +ass<??> +]] +{ + { + label = 'assert(v, message)', + kind = define.CompletionItemKind.Function, + }, +} + +config.set(nil, 'Lua.completion.callSnippet', 'Replace') +TEST [[ +ass<??> +]] +{ + { + label = 'assert(v, message)', + kind = define.CompletionItemKind.Function, + }, +} + +config.set(nil, 'Lua.completion.callSnippet', 'Both') TEST [[ ass<??> ]] |