// Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).

package com.twitter.intellij.pants.file;

import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.FileTypeRegistry;
import com.intellij.openapi.util.io.ByteSequence;
import com.intellij.openapi.vfs.VirtualFile;
import com.jetbrains.python.PythonFileType;
import com.twitter.intellij.pants.util.PantsUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class BUILDFileTypeDetector implements FileTypeRegistry.FileTypeDetector {
  @Nullable
  @Override
  public FileType detect(@NotNull VirtualFile file, @NotNull ByteSequence firstBytes, @Nullable CharSequence firstCharsIfText) {
    return PantsUtil.isBUILDFileName(file.getName()) ? PythonFileType.INSTANCE : null;
  }

  @Override
  public int getVersion() {
    return 1;
  }
}

@@ -548,16 +548,46 @@
 lable;%0A%0A
+import java.util.Collection;%0A%0A
 public c
@@ -905,16 +905,115 @@
 l;%0A  %7D%0A%0A
+  @Nullable%0A  public Collection%3C? extends FileType%3E getDetectedFileTypes() %7B%0A    return null;%0A  %7D%0A%0A
   @Overr

Fix #431