package com.intellij.openapi.vfs.impl.http;

import com.intellij.lang.Language;
import com.intellij.openapi.fileTypes.FileType;
import org.jetbrains.annotations.Nullable;

/**
 * @author nik
 */
public class RemoteFileUtil {
  private RemoteFileUtil() {
  }

  @Nullable
  public static FileType getFileType(@Nullable String contentType) {
    if (contentType == null) return null;

    int end = contentType.indexOf(';');
    String mimeType = end != -1 ? contentType.substring(0, end) : contentType;
    if (mimeType.length() == 0) return null;

    for (Language language : Language.getRegisteredLanguages()) {
      String[] types = language.getMimeTypes();
      for (String type : types) {
        if (type.equalsIgnoreCase(mimeType)) {
          return language.getAssociatedFileType();
        }
      }
    }
    return null;
  }

}

@@ -132,126 +132,649 @@
 ort 
-org.jetbrains.annotations.Nullable;%0A%0A/**%0A * @author nik%0A */%0Apublic class RemoteFileUtil %7B%0A  private RemoteFileUtil() %7B
+com.intellij.openapi.fileTypes.FileTypeManager;%0Aimport com.intellij.openapi.fileTypes.LanguageFileType;%0Aimport org.jetbrains.annotations.Nullable;%0Aimport org.jetbrains.annotations.NotNull;%0A%0A/**%0A * @author nik%0A */%0Apublic class RemoteFileUtil %7B%0A  private RemoteFileUtil() %7B%0A  %7D%0A%0A  @Nullable%0A  private static FileType getFileType(@NotNull Language language) %7B%0A    for (final FileType fileType : FileTypeManager.getInstance().getRegisteredFileTypes()) %7B%0A      if (fileType instanceof LanguageFileType && ((LanguageFileType)fileType).getLanguage() == language) %7B%0A        return fileType;%0A      %7D%0A    %7D%0A    return language.getAssociatedFileType();
 %0A  %7D
@@ -1273,48 +1273,125 @@
     
-return language.getAssociatedFileType();
+FileType fileType = getFileType(language);%0A          if (fileType != null) %7B%0A            return fileType;%0A          %7D
 %0A   

fix remote js debug