@@ -184,7 +184,7 @@ local function buildFunctionSnip(source, value, oop)
184184end
185185
186186local function buildDetail (source )
187- local types = vm .getInfer (source ):view ()
187+ local types = vm .getInfer (source ):view (guide . getUri ( source ) )
188188 local literals = vm .getInfer (source ):viewLiterals ()
189189 if literals then
190190 return types .. ' = ' .. literals
@@ -302,7 +302,7 @@ local function checkLocal(state, word, position, results)
302302 if name :sub (1 , 1 ) == ' @' then
303303 goto CONTINUE
304304 end
305- if vm .getInfer (source ):hasFunction () then
305+ if vm .getInfer (source ):hasFunction (state . uri ) then
306306 local defs = vm .getDefs (source )
307307 -- make sure `function` is before `doc.type.function`
308308 local orders = {}
@@ -513,7 +513,7 @@ local function checkFieldThen(state, name, src, word, startPos, position, parent
513513 })
514514 return
515515 end
516- if oop and not vm .getInfer (src ):hasFunction () then
516+ if oop and not vm .getInfer (src ):hasFunction (state . uri ) then
517517 return
518518 end
519519 local literal = guide .getLiteral (value )
@@ -1440,7 +1440,7 @@ local function tryCallArg(state, position, results)
14401440 : string ()
14411441 end
14421442 enums [# enums + 1 ] = {
1443- label = vm .getInfer (src ):view (),
1443+ label = vm .getInfer (src ):view (state . uri ),
14441444 description = description ,
14451445 kind = define .CompletionItemKind .Function ,
14461446 insertText = insertText ,
@@ -1819,14 +1819,14 @@ local function buildluaDocOfFunction(func)
18191819 local returns = {}
18201820 if func .args then
18211821 for _ , arg in ipairs (func .args ) do
1822- args [# args + 1 ] = vm .getInfer (arg ):view ()
1822+ args [# args + 1 ] = vm .getInfer (arg ):view (guide . getUri ( func ) )
18231823 end
18241824 end
18251825 if func .returns then
18261826 for _ , rtns in ipairs (func .returns ) do
18271827 for n = 1 , # rtns do
18281828 if not returns [n ] then
1829- returns [n ] = vm .getInfer (rtns [n ]):view ()
1829+ returns [n ] = vm .getInfer (rtns [n ]):view (guide . getUri ( func ) )
18301830 end
18311831 end
18321832 end
0 commit comments