Пример #1
4
        public boolean acceptInput(final VirtualFile file) {
          if (!(file.getFileSystem() instanceof LocalFileSystem)) {
            return false;
          }

          final FileType fileType = file.getFileType();
          if (!(fileType instanceof LanguageFileType)) {
            return false;
          }

          final LanguageFileType languageFileType = (LanguageFileType) fileType;
          final Language language = languageFileType.getLanguage();

          return language instanceof TemplateLanguage
              || (language instanceof XMLLanguage && language != XMLLanguage.INSTANCE);
        }
 @NotNull
 public static PsiFile createFileFromText(
     @NotNull Project project,
     @NotNull CharSequence text,
     @NotNull LanguageFileType fileType,
     @NotNull VirtualFile file,
     @NotNull String fileName) {
   final Language language = fileType.getLanguage();
   final Language substitutedLanguage =
       LanguageSubstitutors.INSTANCE.substituteLanguage(language, file, project);
   return PsiFileFactory.getInstance(project)
       .createFileFromText(fileName, substitutedLanguage, text, false, false, true, file);
 }
 private SubstitutedFileType(
     @NotNull FileType originalFileType, @NotNull LanguageFileType substitutionFileType) {
   super(substitutionFileType.getLanguage());
   this.originalFileType = originalFileType;
   this.fileType = substitutionFileType;
 }
 public AbstractLanguageParsingTestCase(final String dataPath, final LanguageFileType fileType) {
   this(dataPath, fileType.getDefaultExtension(), ((IXtextLanguage) fileType.getLanguage()));
 }