summaryrefslogtreecommitdiff
path: root/server/src/method/textDocument/completion.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-01-21 18:17:55 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-01-21 18:17:55 +0800
commit486ad493425397295e38ae19de9ba7051696d61b (patch)
tree13b1f87b9ca0ce7fc113da8c56bd49aef40dec96 /server/src/method/textDocument/completion.lua
parent92f5b7b301473cad98a28cb2a34440a09ca99cd7 (diff)
downloadlua-language-server-486ad493425397295e38ae19de9ba7051696d61b.zip
修正下划线阻断自动完成的BUG
Diffstat (limited to 'server/src/method/textDocument/completion.lua')
-rw-r--r--server/src/method/textDocument/completion.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/src/method/textDocument/completion.lua b/server/src/method/textDocument/completion.lua
index 1e9030b8..b6dd55c4 100644
--- a/server/src/method/textDocument/completion.lua
+++ b/server/src/method/textDocument/completion.lua
@@ -33,12 +33,12 @@ local function findWord(position, text)
local word = text
for i = position-1, 1, -1 do
local c = text:sub(i, i)
- if not c:find '%w' then
+ if not c:find '[%w_]' then
word = text:sub(i+1, position)
break
end
end
- return word:match('^(%w*)')
+ return word:match('^([%w_]*)')
end
return function (lsp, params)