summaryrefslogtreecommitdiff
path: root/script/vm/sign.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-13 17:22:43 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-13 17:22:43 +0800
commit8168da31f270fd82c2e541cfd3fc304ffccc1c9c (patch)
tree35bb67a7ad3c2da77416694262ee501972496c1e /script/vm/sign.lua
parent0bd4a15ffdf4b890e26e97f7c433696422eb2303 (diff)
downloadlua-language-server-8168da31f270fd82c2e541cfd3fc304ffccc1c9c.zip
cleanup
Diffstat (limited to 'script/vm/sign.lua')
-rw-r--r--script/vm/sign.lua10
1 files changed, 4 insertions, 6 deletions
diff --git a/script/vm/sign.lua b/script/vm/sign.lua
index 2f70437f..2fac9528 100644
--- a/script/vm/sign.lua
+++ b/script/vm/sign.lua
@@ -1,6 +1,5 @@
local guide = require 'parser.guide'
local nodeMgr = require 'vm.node'
----@class vm
local vm = require 'vm.vm'
---@class vm.sign
@@ -22,7 +21,6 @@ function mt:resolve(uri, args)
if not args then
return nil
end
- local compiler = require 'vm.compiler'
local globalMgr = require 'vm.global-manager'
local resolved = {}
@@ -48,14 +46,14 @@ function mt:resolve(uri, args)
for n in nodeMgr.eachObject(node) do
if n.type == 'doc.type.array' then
-- number[] -> T[]
- resolve(typeUnit.node, compiler.compileNode(n.node))
+ resolve(typeUnit.node, vm.compileNode(n.node))
end
end
end
if typeUnit.type == 'doc.type.table' then
for _, ufield in ipairs(typeUnit.fields) do
- local ufieldNode = compiler.compileNode(ufield.name)
- local uvalueNode = compiler.compileNode(ufield.extends)
+ local ufieldNode = vm.compileNode(ufield.name)
+ local uvalueNode = vm.compileNode(ufield.extends)
if ufieldNode[1].type == 'doc.generic.name' and uvalueNode[1].type == 'doc.generic.name' then
-- { [number]: number} -> { [K]: V }
local tfieldNode = vm.getTableKey(uri, node, 'any')
@@ -83,7 +81,7 @@ function mt:resolve(uri, args)
break
end
for n in nodeMgr.eachObject(sign) do
- local argNode = compiler.compileNode(arg)
+ local argNode = vm.compileNode(arg)
if argNode then
if sign.optional then
argNode = nodeMgr.removeOptional(argNode)