public static @NotNull @Unmodifiable Set<String> getAllMatchingLanguages(@NotNull String languageId, boolean applyToDialects) {
    Language language = Language.findLanguageByID(languageId);
    if (language == null) {
      // unknown language in plugin.xml, ignore
      return Set.of(languageId);
    }

    Set<String> result;
    if (language instanceof MetaLanguage metaLanguage) {
      Collection<Language> matchingLanguages = metaLanguage.getMatchingLanguages();
      result = new HashSet<>();
      for (Language matchingLanguage : matchingLanguages) {
        result.addAll(getLanguageWithDialects(matchingLanguage, applyToDialects));
      }
    }
    else {
      result = getLanguageWithDialects(language, applyToDialects);
    }

    return Set.copyOf(result);
  }
public static @NotNull @Unmodifiable Set<String> getAllMatchingLanguages(@NotNull String languageId, boolean applyToDialects)