List<VirtualFile> () { List<WSLDistribution> distributions = List.of(); if (WSLUtil.isSystemCompatible() && Experiments.getInstance().isFeatureEnabled("wsl.p9.show.roots.in.file.chooser")) { WslDistributionManager distributionManager = WslDistributionManager.getInstance(); List<WSLDistribution> lastDistributions = ContainerUtil.notNullize(distributionManager.getLastInstalledDistributions()); distributions = lastDistributions; LOG.debug("WSL distributions: ", distributions); distributionManager.getInstalledDistributionsFuture().thenAccept(newDistributions -> { // called on a background thread without read action if (newDistributions.equals(lastDistributions)) { LOG.debug("WSL distributions are up-to-date"); return; } LOG.debug("New WSL distributions: ", newDistributions); model.invoker.invokeLater(() -> { // invokeLater to ensure model.roots are calculated setRoots(getLocalAndWslRoots(newDistributions)); }); }); } return getLocalAndWslRoots(distributions); }