diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-01-21 18:17:55 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-01-21 18:17:55 +0800 |
commit | 486ad493425397295e38ae19de9ba7051696d61b (patch) | |
tree | 13b1f87b9ca0ce7fc113da8c56bd49aef40dec96 /server/src/method/textDocument/completion.lua | |
parent | 92f5b7b301473cad98a28cb2a34440a09ca99cd7 (diff) | |
download | lua-language-server-486ad493425397295e38ae19de9ba7051696d61b.zip |
修正下划线阻断自动完成的BUG
Diffstat (limited to 'server/src/method/textDocument/completion.lua')
-rw-r--r-- | server/src/method/textDocument/completion.lua | 4 |
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) |