void (@NotNull State<PS> state) { TrackingUtil.trackActivity(myProject, ExternalSystemActivityKey.INSTANCE, () -> { Set<PS> settings = state.getLinkedExternalProjectsSettings(); if (settings != null) { setLinkedProjectsSettings(settings, new ExternalSystemSettingsListener<>() { @Override public void onProjectsLinked(@NotNull Collection<PS> settings) { ApplicationManager.getApplication().invokeLater(() -> { AbstractExternalSystemSettings.this.onProjectsLinked(settings); AbstractExternalSystemSettings.this.onProjectsLoaded(settings); }, myProject.getDisposed()); } @Override public void onProjectsUnlinked(@NotNull Set<String> linkedProjectPaths) { ApplicationManager.getApplication().invokeLater(() -> { AbstractExternalSystemSettings.this.onProjectsUnlinked(linkedProjectPaths); }, myProject.getDisposed()); } }); } }); }