summaryrefslogtreecommitdiff
path: root/server/src/method/textDocument/completion.lua
diff options
context:
space:
mode:
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)