private static boolean isLanguageExtension(@NotNull final PsiFile file, @NotNull final PsiElement elementAt) { final Language elementLanguage = elementAt.getLanguage(); if (file.getLanguage() instanceof CompositeLanguage) { CompositeLanguage compositeLanguage = (CompositeLanguage) file.getLanguage(); final Language[] extensions = compositeLanguage.getLanguageExtensionsForFile(file); for(Language extension: extensions) { if (extension == elementLanguage) { return true; } } } return false; }
private static boolean isLanguageExtension(@Nonnull final PsiFile file, @Nonnull final PsiElement elementAt) { final Language elementLanguage = elementAt.getLanguage(); if (file.getLanguage() instanceof CompositeLanguage) { CompositeLanguage compositeLanguage = (CompositeLanguage) file.getLanguage(); final Language[] extensions = compositeLanguage.getLanguageExtensionsForFile(file); for(Language extension: extensions) { if (extension == elementLanguage) { return true; } } } return false; }