TextMateBundleReader (String bundleName) { Path bundleDirectory = getBundleDirectory(bundleName); BundleType bundleType = BundleType.detectBundleType(bundleDirectory); return switch (bundleType) { case TEXTMATE -> readTextMateBundle(bundleDirectory); case SUBLIME -> readSublimeBundle(bundleDirectory); case VSCODE -> readVSCBundle(relativePath -> { try { return Files.newInputStream(bundleDirectory.resolve(relativePath)); } catch (IOException e) { throw new RuntimeException(e); } }); case UNDEFINED -> throw new RuntimeException("Unknown bundle type: " + bundleName); }; }