List<TextMateBundleToLoad> (@NotNull TextMateBuiltinBundlesSettings builtinBundlesSettings) { List<TextMateBundleToLoad> builtinBundles = builtinBundlesSettings.getBuiltinBundles(); if (builtinBundles.isEmpty()) { Path builtinBundlesPath = getBundledBundlePath(); try (Stream<Path> files = Files.list(builtinBundlesPath)) { List<TextMateBundleToLoad> bundles = files .filter(file -> !StringUtil.startsWithChar(file.getFileName().toString(), '.')) .map(file -> new TextMateBundleToLoad(file.getFileName().toString(), file.toString())) .toList(); builtinBundlesSettings.setBuiltinBundles(bundles); return bundles; } catch (Throwable e) { LOG.warn("Couldn't list builtin textmate bundles at " + builtinBundlesPath, e); return Collections.emptyList(); } } else { return builtinBundles; } }