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/test | |
parent | 92f5b7b301473cad98a28cb2a34440a09ca99cd7 (diff) | |
download | lua-language-server-486ad493425397295e38ae19de9ba7051696d61b.zip |
修正下划线阻断自动完成的BUG
Diffstat (limited to 'server/test')
-rw-r--r-- | server/test/completion/init.lua | 4 | ||||
-rw-r--r-- | server/test/crossfile/completion.lua | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/server/test/completion/init.lua b/server/test/completion/init.lua index df841b96..6131ceb8 100644 --- a/server/test/completion/init.lua +++ b/server/test/completion/init.lua @@ -74,12 +74,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 rawset(_G, 'TEST', true) diff --git a/server/test/crossfile/completion.lua b/server/test/crossfile/completion.lua index 6039d1ef..61908dbd 100644 --- a/server/test/crossfile/completion.lua +++ b/server/test/crossfile/completion.lua @@ -78,12 +78,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 function TEST(data) |