summaryrefslogtreecommitdiff
path: root/script/vm/global-manager.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-03-07 20:49:20 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-03-07 20:49:20 +0800
commita31cb772fa4f1da3fd78e4d9f5a01729c22883f7 (patch)
tree956f02534821541185648a4b784e6faa8f998053 /script/vm/global-manager.lua
parentf5f0620a09708c07acbb024a0a98bd8595658116 (diff)
downloadlua-language-server-a31cb772fa4f1da3fd78e4d9f5a01729c22883f7.zip
update
Diffstat (limited to 'script/vm/global-manager.lua')
-rw-r--r--script/vm/global-manager.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/script/vm/global-manager.lua b/script/vm/global-manager.lua
index a225be87..130a11db 100644
--- a/script/vm/global-manager.lua
+++ b/script/vm/global-manager.lua
@@ -1,6 +1,7 @@
local util = require 'utility'
local guide = require 'parser.guide'
local globalBuilder = require 'vm.global'
+local genericMgr = require 'vm.generic-manager'
---@class parser.object
---@field _globalNode vm.node.global
@@ -142,6 +143,20 @@ local compilerGlobalMap = util.switch()
local class = m.declareGlobal('type', name, uri)
class:addSet(uri, source)
source._globalNode = class
+
+ if source.signs then
+ source._generic = genericMgr(source)
+ for _, sign in ipairs(source.signs) do
+ source._generic:addSign(sign)
+ end
+ if source.extends then
+ for _, ext in ipairs(source.extends) do
+ if ext.type == 'doc.type.table' then
+ ext._generic = source._generic:getChild(ext)
+ end
+ end
+ end
+ end
end)
: case 'doc.alias'
: call(function (source)