Java Code Examples for com.intellij.openapi.fileTypes.FileTypeConsumer

The following examples show how to use com.intellij.openapi.fileTypes.FileTypeConsumer. These examples are extracted from open source projects. 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 Project: Buck-IntelliJ-Plugin   Source File: BuckFileTypeFactory.java    License: 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
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
    WeaveFileType weaveFileType = WeaveFileType.getInstance();

    for (String extension : weaveFileType.getExtensions())
        fileTypeConsumer.consume(weaveFileType, extension);
}
 
Example 3
@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 4
Source Project: intellij   Source File: ProjectViewFileTypeFactory.java    License: 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 Project: intellij   Source File: BuildFileTypeFactory.java    License: 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 6
Source Project: BashSupport   Source File: BashFileTypeLoader.java    License: 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 7
Source Project: consulo-unity3d   Source File: Unity3dFileTypeFactory.java    License: 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 Project: idea-gitignore   Source File: IgnoreFileTypeFactory.java    License: 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 9
Source Project: buck   Source File: BcfgFileTypeFactory.java    License: 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 10
Source Project: buck   Source File: BuckFileTypeFactory.java    License: 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 11
Source Project: consulo   Source File: SandFileTypeFactory.java    License: 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 Project: JetBrains-NASM-Language   Source File: NASMFileTypeFactory.java    License: MIT License 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
    fileTypeConsumer.consume(NASMFileType.INSTANCE, NASMFileType.EXTENSION);
}
 
Example 13
Source Project: idea-php-typo3-plugin   Source File: FluidFileTypeFactory.java    License: MIT License 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
    fileTypeConsumer.consume(FluidFileType.INSTANCE);
}
 
Example 14
Source Project: idea-php-typo3-plugin   Source File: TypoScriptFileTypeFactory.java    License: MIT License 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
  fileTypeConsumer.consume(TypoScriptFileType.INSTANCE);
}
 
Example 15
Source Project: bamboo-soy   Source File: SoyFileTypeFactory.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
  fileTypeConsumer.consume(SoyFileType.INSTANCE, "soy");
}
 
Example 16
@Override
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
    final FileType fileType = consumer.getStandardFileTypeByName("XML");
    assert fileType != null;
    consumer.consume(fileType, BPMN_EXTENSION);
}
 
Example 17
Source Project: intellij-csv-validator   Source File: TsvFileTypeFactory.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
    fileTypeConsumer.consume(TsvFileType.INSTANCE, String.join(FileTypeConsumer.EXTENSION_DELIMITER, new String[] {"tsv", "tab"}));
}
 
Example 18
Source Project: intellij-csv-validator   Source File: PsvFileTypeFactory.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
    fileTypeConsumer.consume(PsvFileType.INSTANCE, String.join(FileTypeConsumer.EXTENSION_DELIMITER, new String[] {"psv"}));
}
 
Example 19
Source Project: intellij-csv-validator   Source File: CsvFileTypeFactory.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
    fileTypeConsumer.consume(CsvFileType.INSTANCE, String.join(FileTypeConsumer.EXTENSION_DELIMITER, new String[] {"csv"}));
}
 
Example 20
Source Project: mule-intellij-plugins   Source File: RamlFileTypeFactory.java    License: Apache License 2.0 4 votes vote down vote up
public void createFileTypes(@NotNull FileTypeConsumer consumer)
{
    consumer.consume(RamlFileType.INSTANCE, RamlFileType.EXTENSIONS);
}
 
Example 21
Source Project: mule-intellij-plugins   Source File: MelFileTypeFactory.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
    fileTypeConsumer.consume(MelFileType.getInstance(), "mel");
}
 
Example 22
Source Project: nix-idea   Source File: NixFileTypeFactory.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
    fileTypeConsumer.consume(NixFileType.INSTANCE, "nix");
}
 
Example 23
Source Project: weex-language-support   Source File: WeexFileTypeFactory.java    License: MIT License 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
    fileTypeConsumer.consume(WeexFileType.INSTANCE);
}
 
Example 24
Source Project: arma-intellij-plugin   Source File: SQFFileTypeFactory.java    License: MIT License 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
	consumer.consume(SQFFileType.INSTANCE, "sqf");
}
 
Example 25
Source Project: arma-intellij-plugin   Source File: HeaderFileTypeFactory.java    License: MIT License 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
	consumer.consume(HeaderFileType.INSTANCE, "h;hh;hpp;ext;cpp");
}
 
Example 26
Source Project: Latte-lang   Source File: LatteFileTypeFactory.java    License: MIT License 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
        fileTypeConsumer.consume(LatteFileType.INSTANCE);
}
 
Example 27
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
    fileTypeConsumer.consume(ProtoFileType.INSTANCE, ProtoFileType.FILE_EXTENSION);
}
 
Example 28
Source Project: elm-plugin   Source File: ElmFileTypeFactory.java    License: MIT License 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) {
    fileTypeConsumer.consume(ElmFileType.INSTANCE, "elm");
}
 
Example 29
Source Project: ApiDebugger   Source File: ApiFileTypeFactory.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
    consumer.consume(ApiFileType.INSTANCE);
}
 
Example 30
@Override
public void createFileTypes(@NotNull final FileTypeConsumer fileTypeConsumer) {
    fileTypeConsumer.consume(KubernetesYamlFileType.INSTANCE, "kubernetes");
}