@@ -18,7 +18,6 @@ local lookBackward = require 'core.look-backward'
1818local guide = require ' parser.guide'
1919local await = require ' await'
2020local postfix = require ' core.completion.postfix'
21- local globalMgr = require ' vm.global-manager'
2221
2322local diagnosticModes = {
2423 ' disable-next-line' ,
@@ -351,7 +350,7 @@ local function checkModule(state, word, position, results)
351350 local fileName = path :match ' [^/\\ ]*$'
352351 local stemName = fileName :gsub (' %..+' , ' ' )
353352 if not locals [stemName ]
354- and not globalMgr .hasGlobalSets (state .uri , ' variable' , stemName )
353+ and not vm .hasGlobalSets (state .uri , ' variable' , stemName )
355354 and not config .get (state .uri , ' Lua.diagnostics.globals' )[stemName ]
356355 and stemName :match ' ^[%a_][%w_]*$'
357356 and matchKey (word , stemName ) then
@@ -601,14 +600,14 @@ end
601600--- @async
602601local function checkGlobal (state , word , startPos , position , parent , oop , results )
603602 local locals = guide .getVisibleLocals (state .ast , position )
604- local globals = globalMgr .getGlobalSets (state .uri , ' variable' )
603+ local globals = vm .getGlobalSets (state .uri , ' variable' )
605604 checkFieldOfRefs (globals , state , word , startPos , position , parent , oop , results , locals , ' global' )
606605end
607606
608607--- @async
609608local function checkField (state , word , start , position , parent , oop , results )
610609 if parent .tag == ' _ENV' or parent .special == ' _G' then
611- local globals = globalMgr .getGlobalSets (state .uri , ' variable' )
610+ local globals = vm .getGlobalSets (state .uri , ' variable' )
612611 checkFieldOfRefs (globals , state , word , start , position , parent , oop , results )
613612 else
614613 local refs = vm .getFields (parent )
0 commit comments