summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
authorNathan Craddock <nzcraddock@gmail.com>2021-08-19 09:02:47 -0600
committerNathan Craddock <nzcraddock@gmail.com>2021-08-19 09:02:47 -0600
commit0ae22219224227d756b956b9988b55e9ec66fed6 (patch)
tree17b5be35e59460691bec6f2ed71092fb1890ed79 /script/core
parent822e794883b41bf5e8758cce5d4601a69f3ee874 (diff)
downloadlua-language-server-0ae22219224227d756b956b9988b55e9ec66fed6.zip
Change completion.word to completion.showWord
Updates the config option from a boolean to a string that has three supported values: * Disable: Never show text completions * Enable: Always show text completions * Fallback: Only show text completions as a fallback when there are no semantic completions found.
Diffstat (limited to 'script/core')
-rw-r--r--script/core/completion.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/script/core/completion.lua b/script/core/completion.lua
index 6914e9cf..0d837b08 100644
--- a/script/core/completion.lua
+++ b/script/core/completion.lua
@@ -624,11 +624,14 @@ local function checkTableField(ast, word, start, results)
end
local function checkCommon(myUri, word, text, offset, results)
- if not config.get 'Lua.completion.word' then
+ local showWord = config.get 'Lua.completion.showWord'
+ if showWord == 'Disable' then
return
end
-
results.enableCommon = true
+ if showWord == 'Fallback' and #results ~= 0 then
+ return
+ end
local used = {}
for _, result in ipairs(results) do
used[result.label:match '^[^(]*'] = true