void (@NotNull ProgressIndicator indicator) { if (myProject.isDisposed()) { return; } if (isSdkDisposed()) { return; } if (Trigger.LOG.isDebugEnabled()) { Trigger.LOG.debug( "Starting SDK refresh for '" + mySdk.getName() + "' triggered by " + Trigger.getCauseByTrace(myRequestData.myTraceback)); } try { if (Registry.get("python.use.targets.api").asBoolean()) { PyTargetsIntrospectionFacade targetsFacade = new PyTargetsIntrospectionFacade(mySdk, myProject); String version = targetsFacade.getInterpreterVersion(indicator); commitSdkVersionIfChanged(mySdk, version); if (targetsFacade.isLocalTarget()) { List<String> paths = targetsFacade.getInterpreterPaths(indicator); updateSdkPaths(mySdk, paths, myProject); } else { targetsFacade.synchronizeRemoteSourcesAndSetupMappings(indicator); } } else { updateLocalSdkVersionAndPaths(mySdk, myProject); } // This step also includes setting mapped interpreter paths generateSkeletons(mySdk, indicator); refreshPackages(mySdk, indicator); } catch (InvalidSdkException | ExecutionException e) { LOG.warn("Update for SDK " + mySdk.getName() + " failed", e); } finally { // restart code analysis ApplicationManager.getApplication().invokeLater(() -> DaemonCodeAnalyzer.getInstance(myProject).restart(), myProject.getDisposed()); } }