blob: 22f72ae618561d479a4bcfe2d1129f1b2d194e27 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
local mt = require 'vm.manager'
function mt:clearEmmy()
self._emmy = nil
end
function mt:doEmmy(action)
local tp = action.type
if tp == 'emmyClass' then
self:doEmmyClass(action)
elseif tp == 'emmyType' then
self:doEmmyType(action)
elseif tp == 'emmyAlias' then
elseif tp == 'emmyParam' then
elseif tp == 'emmyReturn' then
elseif tp == 'emmyField' then
elseif tp == 'emmyGeneric' then
elseif tp == 'emmyVararg' then
elseif tp == 'emmyLanguage' then
elseif tp == 'emmyArrayType' then
elseif tp == 'emmyTableType' then
elseif tp == 'emmyFunctionType' then
elseif tp == 'emmySee' then
elseif tp == 'emmyIncomplete' then
self:doEmmyIncomplete(action)
end
end
function mt:getEmmy()
local emmy = self._emmy
self._emmy = nil
return emmy
end
function mt:doEmmyClass(action)
local emmyMgr = self.emmyMgr
self:instantSource(action)
local class = emmyMgr:addClass(action)
local extends = action[2]
if extends then
self:instantSource(extends)
extends:set('target class', extends[1])
end
self._emmy = class
action:set('emmy.class', class)
if self.lsp then
self.lsp.global:markSet(self:getUri())
end
end
function mt:doEmmyType(action)
local emmyMgr = self.emmyMgr
self:instantSource(action)
local type = emmyMgr:createType(action)
self._emmy = type
action:set('emmy.type', type)
for _, obj in ipairs(action) do
self:instantSource(obj)
obj:set('target class', obj[1])
end
if self.lsp then
self.lsp.global:markGet(self:getUri())
end
end
function mt:doEmmyIncomplete(action)
self:instantSource(action)
end
|