summaryrefslogtreecommitdiff
path: root/server/src/method/textDocument/completion.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-01-21 16:13:17 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-01-21 16:13:17 +0800
commit961d11ad4bd4834dab7a7108dc95298331374fe8 (patch)
tree6136ac2f35efb10b52ccf34ddd15d890fb3e0043 /server/src/method/textDocument/completion.lua
parent0cbeef42edd65845900a7b51254b902c3f798e5c (diff)
downloadlua-language-server-961d11ad4bd4834dab7a7108dc95298331374fe8.zip
修正一个缓存bug
Diffstat (limited to 'server/src/method/textDocument/completion.lua')
-rw-r--r--server/src/method/textDocument/completion.lua11
1 files changed, 5 insertions, 6 deletions
diff --git a/server/src/method/textDocument/completion.lua b/server/src/method/textDocument/completion.lua
index 2891b4b2..2e1eb5f0 100644
--- a/server/src/method/textDocument/completion.lua
+++ b/server/src/method/textDocument/completion.lua
@@ -17,18 +17,17 @@ local function posToRange(lines, start, finish)
end
local function findStartPos(pos, buf)
+ local res = pos
for i = pos-1, 1, -1 do
local c = buf:sub(i, i)
if c:find '%a' then
- goto CONTINUE
+ res = i
end
- if c == '.' then
- return nil
+ if c == '.' or c == ':' then
+ break
end
- do return i + 1 end
- ::CONTINUE::
end
- return pos
+ return res
end
return function (lsp, params)