summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/src/matcher/completion.lua16
-rw-r--r--server/test/completion/init.lua5
2 files changed, 13 insertions, 8 deletions
diff --git a/server/src/matcher/completion.lua b/server/src/matcher/completion.lua
index 8f74b7c7..29a86d10 100644
--- a/server/src/matcher/completion.lua
+++ b/server/src/matcher/completion.lua
@@ -386,22 +386,20 @@ end
return function (vm, pos)
local result, source = findResult(vm, pos)
- local inCall, inString
if not result then
+ isClose = true
result, source = findClosePos(vm, pos)
if not result then
return nil
end
end
- inString = getString(vm, pos)
- if inString then
- local calls = findCall(vm, pos)
- if not calls then
- return nil
- end
+ local inCall
+ local calls = findCall(vm, pos)
+ if calls then
inCall = calls[#calls]
end
+ local inString = getString(vm, pos)
local list = {}
local mark = {}
@@ -435,7 +433,9 @@ return function (vm, pos)
if inCall then
searchInArg(vm, inCall, inString, callback)
- else
+ end
+
+ if result and not inString then
if result.type == 'local' then
if source.isArg then
searchAsArg(vm, pos, result, callback)
diff --git a/server/test/completion/init.lua b/server/test/completion/init.lua
index c64ffcca..edefd51d 100644
--- a/server/test/completion/init.lua
+++ b/server/test/completion/init.lua
@@ -371,3 +371,8 @@ collectgarbage('@')
documentation = EXISTS,
},
}
+
+TEST [[
+collectgarbage(@)
+]]
+(EXISTS)