summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md1
-rw-r--r--script/core/completion.lua1
-rw-r--r--test/completion/init.lua7
3 files changed, 9 insertions, 0 deletions
diff --git a/changelog.md b/changelog.md
index 005cf51a..d70e8a19 100644
--- a/changelog.md
+++ b/changelog.md
@@ -3,6 +3,7 @@
## 1.20.3
`FIX` [#479](https://github.com/sumneko/lua-language-server/issues/479)
`FIX` [#483](https://github.com/sumneko/lua-language-server/issues/483)
+`FIX` [#485](https://github.com/sumneko/lua-language-server/issues/485)
## 1.20.2
`2021-4-2`
diff --git a/script/core/completion.lua b/script/core/completion.lua
index f710b953..b01699a6 100644
--- a/script/core/completion.lua
+++ b/script/core/completion.lua
@@ -1397,6 +1397,7 @@ local function tryCallArg(ast, text, offset, results)
end
local function tryTable(ast, text, offset, results)
+ offset = lookBackward.skipSpace(text, offset)
local source = findNearestSource(ast, offset)
if not source then
return
diff --git a/test/completion/init.lua b/test/completion/init.lua
index fb042fe9..c648d379 100644
--- a/test/completion/init.lua
+++ b/test/completion/init.lua
@@ -2506,3 +2506,10 @@ TEST [[
elseif $ then
]]
(nil)
+
+TEST [[
+---@type iolib
+local t = {
+ $
+]]
+(EXISTS)