diff --git a/src/Analysis/Ast/Impl/Analyzer/AnalysisWalker.cs b/src/Analysis/Ast/Impl/Analyzer/AnalysisWalker.cs index 76ee7eb87..be910021f 100644 --- a/src/Analysis/Ast/Impl/Analyzer/AnalysisWalker.cs +++ b/src/Analysis/Ast/Impl/Analyzer/AnalysisWalker.cs @@ -39,7 +39,6 @@ internal abstract class AnalysisWalker : PythonWalkerAsync { public ExpressionEval Eval { get; } public IPythonModule Module => Eval.Module; - public IPythonInterpreter Interpreter => Eval.Interpreter; public PythonAst Ast => Eval.Ast; protected ModuleSymbolTable SymbolTable => Eval.SymbolTable; diff --git a/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs b/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs index 16d79bcc4..2fc8a019f 100644 --- a/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs +++ b/src/Analysis/Ast/Impl/Modules/Resolution/MainModuleResolution.cs @@ -174,19 +174,15 @@ internal async Task LoadBuiltinTypesAsync(CancellationToken cancellationToken = public async Task ReloadAsync(CancellationToken cancellationToken = default) { ModuleCache = new ModuleCache(_interpreter, _services); - PathResolver = new PathResolver(_interpreter.LanguageVersion); - - var addedRoots = PathResolver.SetRoot(_root); - ReloadModulePaths(addedRoots); - + + var addedRoots = new HashSet(); + addedRoots.UnionWith(PathResolver.SetRoot(_root)); + var interpreterPaths = await GetSearchPathsAsync(cancellationToken); - addedRoots = PathResolver.SetInterpreterSearchPaths(interpreterPaths); - - ReloadModulePaths(addedRoots); - cancellationToken.ThrowIfCancellationRequested(); - - addedRoots = SetUserSearchPaths(_interpreter.Configuration.SearchPaths); + addedRoots.UnionWith(PathResolver.SetInterpreterSearchPaths(interpreterPaths)); + + addedRoots.UnionWith(SetUserSearchPaths(_interpreter.Configuration.SearchPaths)); ReloadModulePaths(addedRoots); }