summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-05 00:25:43 +0800
committerGitHub <noreply@github.com>2022-04-05 00:25:43 +0800
commit02e76eeb7c12454da8e6d961510164becfe4f2c3 (patch)
tree8070b6bae645ed41d264a5f013d8067d6ca9381e
parent53ce34380c42036ca2d1ccc9f1ad969e354ba635 (diff)
parentd539858421bd550b8731cef036ff4da1e7d623c0 (diff)
downloadlua-language-server-02e76eeb7c12454da8e6d961510164becfe4f2c3.zip
Merge pull request #1017 from kevinhwang91/fix-trigger-completion
fix(completion): avoid unnecessary file sep as trigger chars
-rw-r--r--script/provider/completion.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/script/provider/completion.lua b/script/provider/completion.lua
index 3c0c82d7..7714525a 100644
--- a/script/provider/completion.lua
+++ b/script/provider/completion.lua
@@ -7,7 +7,7 @@ local ws = require 'workspace'
local isEnable = false
local function allWords()
- local str = '\t\n.:(\'"[,#*@|=-{/\\ +?'
+ local str = '\t\n.:(\'"[,#*@|=-{ +?'
local mark = {}
local list = {}
for c in str:gmatch '.' do
@@ -20,6 +20,11 @@ local function allWords()
list[#list+1] = postfix
mark[postfix] = true
end
+ local separator = config.get(scp.uri, 'Lua.completion.requireSeparator')
+ if not mark[separator] then
+ list[#list+1] = separator
+ mark[separator] = true
+ end
end
return list
end