summaryrefslogtreecommitdiff
path: root/server/src/method/textDocument
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-01-21 17:09:22 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-01-21 17:09:22 +0800
commit3100e00a07bc390514bb57822e02dbc4b0442dea (patch)
tree804daba937e0f1cb8316f6cb7666f46b91c8162a /server/src/method/textDocument
parent71d24c50b9b44dbd1b14958e7941fb7c9a1ab11c (diff)
downloadlua-language-server-3100e00a07bc390514bb57822e02dbc4b0442dea.zip
修正bug
Diffstat (limited to 'server/src/method/textDocument')
-rw-r--r--server/src/method/textDocument/completion.lua12
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)