diff options
Diffstat (limited to 'server/src/method/textDocument/completion.lua')
-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) |