@@ -324,7 +324,13 @@ local function load3rdConfigInDir(dir, configs, inner)
324324end
325325
326326local function load3rdConfig (uri )
327- local configs = {}
327+ local scp = scope .getScope (uri )
328+ local configs = scp :get ' thirdConfigsCache'
329+ if configs then
330+ return configs
331+ end
332+ configs = {}
333+ scp :set (' thirdConfigsCache' , configs )
328334 load3rdConfigInDir (innerThirdDir , configs , true )
329335 local thirdDirs = config .get (uri , ' Lua.workspace.userThirdParty' )
330336 for _ , thirdDir in ipairs (thirdDirs ) do
@@ -487,7 +493,6 @@ local function check3rdByFileName(uri, configs)
487493 end , id )
488494end
489495
490- local thirdConfigs
491496--- @async
492497local function check3rd (uri )
493498 if hasAsked then
@@ -499,9 +504,7 @@ local function check3rd(uri)
499504 if not config .get (uri , ' Lua.workspace.checkThirdParty' ) then
500505 return
501506 end
502- if thirdConfigs == nil then
503- thirdConfigs = load3rdConfig (uri ) or false
504- end
507+ local thirdConfigs = load3rdConfig (uri ) or false
505508 if not thirdConfigs then
506509 return
507510 end
@@ -510,7 +513,9 @@ local function check3rd(uri)
510513end
511514
512515local function check3rdOfWorkspace (suri )
513- local id = ' check3rdOfWorkspace:' .. suri
516+ local scp = scope .getScope (suri )
517+ scp :set (' thirdConfigsCache' , nil )
518+ local id = ' check3rdOfWorkspace:' .. scp :getName ()
514519 await .close (id )
515520 --- @async
516521 await .call (function ()
@@ -529,7 +534,8 @@ config.watch(function (uri, key, value, oldValue)
529534 initBuiltIn (uri )
530535 end
531536 if key == ' Lua.workspace.checkThirdParty'
532- or key == ' Lua.workspace.userThirdParty' then
537+ or key == ' Lua.workspace.userThirdParty'
538+ or key == ' ' then
533539 check3rdOfWorkspace (uri )
534540 end
535541end )
0 commit comments