@@ -16,7 +16,6 @@ local rpath = require 'workspace.require-path'
1616local lang = require ' language'
1717local lookBackward = require ' core.look-backward'
1818local guide = require ' parser.guide'
19- local infer = require ' vm.infer'
2019local await = require ' await'
2120local postfix = require ' core.completion.postfix'
2221local globalMgr = require ' vm.global-manager'
@@ -186,8 +185,8 @@ local function buildFunctionSnip(source, value, oop)
186185end
187186
188187local function buildDetail (source )
189- local types = infer .getInfer (source ):view ()
190- local literals = infer .getInfer (source ):viewLiterals ()
188+ local types = vm .getInfer (source ):view ()
189+ local literals = vm .getInfer (source ):viewLiterals ()
191190 if literals then
192191 return types .. ' = ' .. literals
193192 else
@@ -304,7 +303,7 @@ local function checkLocal(state, word, position, results)
304303 if name :sub (1 , 1 ) == ' @' then
305304 goto CONTINUE
306305 end
307- if infer .getInfer (source ):hasFunction () then
306+ if vm .getInfer (source ):hasFunction () then
308307 for _ , def in ipairs (vm .getDefs (source )) do
309308 if def .type == ' function'
310309 or def .type == ' doc.type.function' then
@@ -499,7 +498,7 @@ local function checkFieldThen(state, name, src, word, startPos, position, parent
499498 })
500499 return
501500 end
502- if oop and not infer .getInfer (src ):hasFunction () then
501+ if oop and not vm .getInfer (src ):hasFunction () then
503502 return
504503 end
505504 local literal = guide .getLiteral (value )
@@ -1118,7 +1117,7 @@ local function checkTypingEnum(state, position, defs, str, results)
11181117 or def .type == ' doc.type.integer'
11191118 or def .type == ' doc.type.boolean' then
11201119 enums [# enums + 1 ] = {
1121- label = infer .viewObject (def ),
1120+ label = vm .viewObject (def ),
11221121 description = def .comment and def .comment .text ,
11231122 kind = define .CompletionItemKind .EnumMember ,
11241123 }
@@ -1407,7 +1406,7 @@ local function tryCallArg(state, position, results)
14071406 or src .type == ' doc.type.integer'
14081407 or src .type == ' doc.type.boolean' then
14091408 enums [# enums + 1 ] = {
1410- label = infer .viewObject (src ),
1409+ label = vm .viewObject (src ),
14111410 description = src .comment ,
14121411 kind = define .CompletionItemKind .EnumMember ,
14131412 }
@@ -1426,7 +1425,7 @@ local function tryCallArg(state, position, results)
14261425 : string ()
14271426 end
14281427 enums [# enums + 1 ] = {
1429- label = infer .getInfer (src ):view (),
1428+ label = vm .getInfer (src ):view (),
14301429 description = description ,
14311430 kind = define .CompletionItemKind .Function ,
14321431 insertText = insertText ,
@@ -1805,14 +1804,14 @@ local function buildluaDocOfFunction(func)
18051804 local returns = {}
18061805 if func .args then
18071806 for _ , arg in ipairs (func .args ) do
1808- args [# args + 1 ] = infer .getInfer (arg ):view ()
1807+ args [# args + 1 ] = vm .getInfer (arg ):view ()
18091808 end
18101809 end
18111810 if func .returns then
18121811 for _ , rtns in ipairs (func .returns ) do
18131812 for n = 1 , # rtns do
18141813 if not returns [n ] then
1815- returns [n ] = infer .getInfer (rtns [n ]):view ()
1814+ returns [n ] = vm .getInfer (rtns [n ]):view ()
18161815 end
18171816 end
18181817 end
0 commit comments