Skip to content

Commit 02e76ee

Browse files
authored
Merge pull request #1017 from kevinhwang91/fix-trigger-completion
fix(completion): avoid unnecessary file sep as trigger chars
2 parents 53ce343 + d539858 commit 02e76ee

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

script/provider/completion.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ local ws = require 'workspace'
77
local isEnable = false
88

99
local function allWords()
10-
local str = '\t\n.:(\'"[,#*@|=-{/\\ +?'
10+
local str = '\t\n.:(\'"[,#*@|=-{ +?'
1111
local mark = {}
1212
local list = {}
1313
for c in str:gmatch '.' do
@@ -20,6 +20,11 @@ local function allWords()
2020
list[#list+1] = postfix
2121
mark[postfix] = true
2222
end
23+
local separator = config.get(scp.uri, 'Lua.completion.requireSeparator')
24+
if not mark[separator] then
25+
list[#list+1] = separator
26+
mark[separator] = true
27+
end
2328
end
2429
return list
2530
end

0 commit comments

Comments
 (0)