Java 类com.intellij.lang.CompositeLanguage 实例源码

项目:intellij-ce-playground    文件:SelectWordHandler.java   
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;
}
项目:tools-idea    文件:SelectWordHandler.java   
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;
}
项目:consulo    文件:SelectWordHandler.java   
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;
}