summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/libs/@lua/file.lni4
-rw-r--r--server/libs/@lua/io.lni4
-rw-r--r--server/src/core/completion.lua4
-rw-r--r--server/test/completion/init.lua5
4 files changed, 11 insertions, 6 deletions
diff --git a/server/libs/@lua/file.lni b/server/libs/@lua/file.lni
index 889cbf2d..f75a02ab 100644
--- a/server/libs/@lua/file.lni
+++ b/server/libs/@lua/file.lni
@@ -21,10 +21,10 @@ type = 'string'
``````````
name = 'code'
[[.enums]]
-type = 'type'
+name = 'type'
enum = 'exit'
``````````
-type = 'type'
+name = 'type'
enum = 'signal'
[flush]
diff --git a/server/libs/@lua/io.lni b/server/libs/@lua/io.lni
index d267a2e3..69765784 100644
--- a/server/libs/@lua/io.lni
+++ b/server/libs/@lua/io.lni
@@ -44,10 +44,10 @@ type = 'string'
``````````
name = 'code'
[[.enums]]
-type = 'type'
+name = 'type'
enum = 'exit'
``````````
-type = 'type'
+name = 'type'
enum = 'signal'
[flush]
diff --git a/server/src/core/completion.lua b/server/src/core/completion.lua
index 42788186..0ed9fd31 100644
--- a/server/src/core/completion.lua
+++ b/server/src/core/completion.lua
@@ -556,7 +556,7 @@ local function searchEnumAsLib(vm, source, word, callback, pos, args, lib)
local arg = lib.args[select]
local name = arg and arg.name
for _, enum in ipairs(lib.enums) do
- if enum.name == name and enum.enum then
+ if enum.name and enum.name == name and enum.enum then
if matchKey(word, enum.enum) then
local label, textEdit
if source.type ~= (arg and arg.type) then
@@ -657,7 +657,7 @@ local function searchCallArg(vm, source, word, callback, pos)
if isInFunctionOrTable(call, pos) then
return
end
-
+
local args = call:bindCall()
if not args then
return
diff --git a/server/test/completion/init.lua b/server/test/completion/init.lua
index 86fa1f28..5450fcf6 100644
--- a/server/test/completion/init.lua
+++ b/server/test/completion/init.lua
@@ -1234,3 +1234,8 @@ z$
}
}
}
+
+TEST [[
+io.close(1, $)
+]]
+(nil)