diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-01-21 17:09:22 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-01-21 17:09:22 +0800 |
commit | 3100e00a07bc390514bb57822e02dbc4b0442dea (patch) | |
tree | 804daba937e0f1cb8316f6cb7666f46b91c8162a /server/src/method/textDocument | |
parent | 71d24c50b9b44dbd1b14958e7941fb7c9a1ab11c (diff) | |
download | lua-language-server-3100e00a07bc390514bb57822e02dbc4b0442dea.zip |
修正bug
Diffstat (limited to 'server/src/method/textDocument')
-rw-r--r-- | server/src/method/textDocument/completion.lua | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/server/src/method/textDocument/completion.lua b/server/src/method/textDocument/completion.lua index 8af4db95..25cb155a 100644 --- a/server/src/method/textDocument/completion.lua +++ b/server/src/method/textDocument/completion.lua @@ -17,18 +17,16 @@ local function posToRange(lines, start, finish) end local function findStartPos(pos, buf) + local res = nil for i = pos-1, 1, -1 do local c = buf:sub(i, i) if c:find '%a' then - goto CONTINUE + res = i + else + break end - if c == '.' or c == ':' then - return nil - end - do return i + 1 end - ::CONTINUE:: end - return 1 + return res end local function findWord(position, text) |