summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/src/method/textDocument/completion.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/server/src/method/textDocument/completion.lua b/server/src/method/textDocument/completion.lua
index 24961f43..2ecc06a5 100644
--- a/server/src/method/textDocument/completion.lua
+++ b/server/src/method/textDocument/completion.lua
@@ -9,6 +9,9 @@ return function (lsp, params)
-- lua是从1开始的,因此都要+1
local position = lines:position(params.position.line + 1, params.position.character + 1)
local items = matcher.completion(vm, position)
+ if not items then
+ return nil
+ end
for i, item in ipairs(items) do
item.sortText = ('%04d'):format(i)
end