com.intellij.openapi.fileTypes.FileTypeConsumer Java Examples

The following examples show how to use com.intellij.openapi.fileTypes.FileTypeConsumer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BuckFileTypeFactory.java    From Buck-IntelliJ-Plugin with Apache License 2.0 6 votes vote down vote up
@Override
public void createFileTypes(FileTypeConsumer fileTypeConsumer) {
  fileTypeConsumer.consume(
      BuckFileType.INSTANCE, new FileNameMatcherEx() {
        @Override
        public String getPresentableString() {
          return BuckFileUtil.getBuildFileName();
        }

        @Override
        public boolean acceptsCharSequence(CharSequence fileName) {
          String buildFileName = BuckFileUtil.getBuildFileName();
          return StringUtilRt.endsWithIgnoreCase(fileName, buildFileName) ||
            Comparing.equal(fileName, buildFileName, true);
        }
      });
}
 
Example #2
Source File: WeaveFileTypeFactory.java    From mule-intellij-plugins with Apache License 2.0 5 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
    WeaveFileType weaveFileType = WeaveFileType.getInstance();

    for (String extension : weaveFileType.getExtensions())
        fileTypeConsumer.consume(weaveFileType, extension);
}
 
Example #3
Source File: BuildFileTypeFactory.java    From intellij with Apache License 2.0 5 votes vote down vote up
@Override
public void createFileTypes(@NotNull final FileTypeConsumer consumer) {
  ImmutableList<FileNameMatcher> fileNameMatchers =
      ImmutableList.<FileNameMatcher>builder()
          .addAll(BuildSystemProvider.defaultBuildSystem().buildLanguageFileTypeMatchers())
          .add()
          .build();
  consumer.consume(BuildFileType.INSTANCE, fileNameMatchers.toArray(new FileNameMatcher[0]));
}
 
Example #4
Source File: ProjectViewFileTypeFactory.java    From intellij with Apache License 2.0 5 votes vote down vote up
@Override
public void createFileTypes(@NotNull final FileTypeConsumer consumer) {
  FileNameMatcher[] matchers =
      ProjectViewStorageManager.VALID_EXTENSIONS
          .stream()
          .map(ExtensionFileNameMatcher::new)
          .toArray(ExtensionFileNameMatcher[]::new);
  consumer.consume(ProjectViewFileType.INSTANCE, matchers);
}
 
Example #5
Source File: ProtostuffPluginController.java    From protobuf-jetbrains-plugin with Apache License 2.0 5 votes vote down vote up
@NotNull
private List<FileNameMatcher> parse(@Nullable String semicolonDelimited) {
    if (semicolonDelimited == null) {
        return Collections.emptyList();
    }

    StringTokenizer tokenizer = new StringTokenizer(semicolonDelimited, FileTypeConsumer.EXTENSION_DELIMITER, false);
    ArrayList<FileNameMatcher> list = new ArrayList<>();
    while (tokenizer.hasMoreTokens()) {
        list.add(new ExtensionFileNameMatcher(tokenizer.nextToken().trim()));
    }
    return list;
}
 
Example #6
Source File: IgnoreFileTypeFactory.java    From idea-gitignore with MIT License 5 votes vote down vote up
/**
 * Assigns file types with languages.
 *
 * @param consumer file types consumer
 */
@Override
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
    consume(consumer, IgnoreFileType.INSTANCE);
    for (final IgnoreLanguage language : IgnoreBundle.LANGUAGES) {
        // skip already bundled languages
        if (language instanceof GitLanguage
                || language instanceof GitExcludeLanguage
                || language instanceof MercurialLanguage) {
            continue;
        }

        consume(consumer, language.getFileType());
    }
}
 
Example #7
Source File: Unity3dFileTypeFactory.java    From consulo-unity3d with Apache License 2.0 5 votes vote down vote up
@Override
public void createFileTypes(@Nonnull FileTypeConsumer consumer)
{
	consumer.consume(Unity3dMetaFileType.INSTANCE);
	consumer.consume(Unity3dBinaryAssetFileType.INSTANCE);
	consumer.consume(Unity3dYMLAssetFileType.INSTANCE);

	consumer.consume(Unity3dBinaryFileType.INSTANCE, "fbx");
}
 
Example #8
Source File: BcfgFileTypeFactory.java    From buck with Apache License 2.0 5 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
  fileTypeConsumer.consume(
      BcfgFileType.INSTANCE,
      new ExtensionFileNameMatcher(BcfgFileType.DEFAULT_EXTENSION),
      new ExactFileNameMatcher(".buckconfig.local"),
      new ExtensionFileNameMatcher("bcfg"));
}
 
Example #9
Source File: BuckFileTypeFactory.java    From buck with Apache License 2.0 5 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
  fileTypeConsumer.consume(
      BuckFileType.INSTANCE,
      new ExactFileNameMatcher(BuckFileType.DEFAULT_FILENAME),
      new ExtensionFileNameMatcher(BuckFileType.DEFAULT_FILENAME),
      new ExtensionFileNameMatcher(BuckFileType.DEFAULT_EXTENSION));
}
 
Example #10
Source File: BashFileTypeLoader.java    From BashSupport with Apache License 2.0 5 votes vote down vote up
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
    consumer.consume(BashFileType.BASH_FILE_TYPE, BashFileType.SH_EXTENSION);
    consumer.consume(BashFileType.BASH_FILE_TYPE, BashFileType.BASH_EXTENSION);

    consumer.consume(BashFileType.BASH_FILE_TYPE,
            new ExactFileNameMatcher(BashFileType.BASHRC_FILENAME),
            new ExactFileNameMatcher(BashFileType.PROFILE_FILENAME),
            new ExactFileNameMatcher(BashFileType.BASH_LOGOUT_FILENAME),
            new ExactFileNameMatcher(BashFileType.BASH_PROFILE_FILENAME),
            new ExactFileNameMatcher(BashFileType.BASH_ALIASES_FILENAME));
}
 
Example #11
Source File: SandFileTypeFactory.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public void createFileTypes(@Nonnull FileTypeConsumer consumer) {
  for (LanguageVersion languageVersion : SandLanguage.INSTANCE.getVersions()) {
    BaseSandLanguageVersion sandLanguageVersion = (BaseSandLanguageVersion) languageVersion;
    consumer.consume(sandLanguageVersion.getFileType());
  }
}
 
Example #12
Source File: DustFileTypeFactory.java    From Intellij-Dust with MIT License 4 votes vote down vote up
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
  consumer.consume(DustFileType.INSTANCE, DustFileType.DEFAULT_EXTENSION);
}
 
Example #13
Source File: EnforcedPlainTextFileTypeFactory.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void createFileTypes(final @Nonnull FileTypeConsumer consumer) {
  consumer.consume(myFileType, "");
}
 
Example #14
Source File: VcsFileTypeFactory.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void createFileTypes(@Nonnull FileTypeConsumer consumer) {
  consumer.consume(PatchFileType.INSTANCE, VcsConfiguration.PATCH + ";" + VcsConfiguration.DIFF);
}
 
Example #15
Source File: DslFileTypeFactory.java    From dsl-compiler-client with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
	fileTypeConsumer.consume(DslFileType.INSTANCE, "dsl");
}
 
Example #16
Source File: ANTLRv4FileTypeFactory.java    From intellij-plugin-v4 with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
    fileTypeConsumer.consume(ANTLRv4FileType.INSTANCE, "g4");
}
 
Example #17
Source File: XQueryFileTypeFactory.java    From intellij-xquery with Apache License 2.0 4 votes vote down vote up
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
    consumer.consume(INSTANCE, ALL_EXTENSIONS);
}
 
Example #18
Source File: HXMLFileTypeFactory.java    From intellij-haxe with Apache License 2.0 4 votes vote down vote up
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
  consumer.consume(
    HXMLFileType.INSTANCE,
    new ExtensionFileNameMatcher(HXMLFileType.DEFAULT_EXTENSION));
}
 
Example #19
Source File: ThriftFileTypeLoader.java    From intellij-thrift with Apache License 2.0 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
  fileTypeConsumer.consume(ThriftFileType.INSTANCE);
}
 
Example #20
Source File: SpecFileTypeFactory.java    From Intellij-Plugin with Apache License 2.0 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
    fileTypeConsumer.consume(SpecFileType.INSTANCE, SPEC_EXTENSION);
    fileTypeConsumer.consume(SpecFileType.INSTANCE, MD_EXTENSION);
    fileTypeConsumer.consume(ConceptFileType.INSTANCE, CONCEPT_EXTENSION);
}
 
Example #21
Source File: YangFileTypeFactory.java    From intellij-yang with Apache License 2.0 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
    fileTypeConsumer.consume(YangFileType.INSTANCE, "yang");
}
 
Example #22
Source File: ESLintConfigFileTypeFactory.java    From eslint-plugin with MIT License 4 votes vote down vote up
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
        consumer.consume(ESLintConfigFileType.INSTANCE, new ExactFileNameMatcher(ESLintConfigFileType.ESLINTRC));
//                new ExtensionFileNameMatcher(ESLintConfigFileType.ESLINTRC), new ExactFileNameMatcher("eslint.json"));
    }
 
Example #23
Source File: CGFileTypeFactory.java    From consulo-unity3d with Apache License 2.0 4 votes vote down vote up
@Override
public void createFileTypes(@Nonnull FileTypeConsumer consumer)
{
	consumer.consume(CGFileType.INSTANCE);
	consumer.consume(CGFileType.INSTANCE, "cginc");
}
 
Example #24
Source File: ShaderLabFileTypeFactory.java    From consulo-unity3d with Apache License 2.0 4 votes vote down vote up
@Override
public void createFileTypes(@Nonnull FileTypeConsumer fileTypeConsumer)
{
	fileTypeConsumer.consume(ShaderLabFileType.INSTANCE);
}
 
Example #25
Source File: SimpleFileTypeFactory.java    From intellij-sdk-docs with Apache License 2.0 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
  fileTypeConsumer.consume(SimpleFileType.INSTANCE);
}
 
Example #26
Source File: PexFileTypeFactory.java    From intellij-pants-plugin with Apache License 2.0 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
  consumer.consume(ArchiveFileType.INSTANCE, "pex");
}
 
Example #27
Source File: RTFileTypeFactory.java    From react-templates-plugin with MIT License 4 votes vote down vote up
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
    consumer.consume(RTFileType.INSTANCE);
}
 
Example #28
Source File: ISMLLanguageTypeFactory.java    From intellij-demandware with MIT License 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
    consumer.consume(ISMLFileType.INSTANCE, "isml");
}
 
Example #29
Source File: SampleFileTypeFactory.java    From jetbrains-plugin-sample with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
	fileTypeConsumer.consume(SampleFileType.INSTANCE, SampleFileType.FILE_EXTENSION);
}
 
Example #30
Source File: MyFileTypeFactory.java    From svgtoandroid with MIT License 4 votes vote down vote up
@Override
public void createFileTypes(FileTypeConsumer fileTypeConsumer) {
    fileTypeConsumer.consume(XmlFileType.INSTANCE,"svg");
}