package org.jetbrains.haskell;

import com.intellij.compiler.CompilerWorkspaceConfiguration;
import com.intellij.openapi.compiler.CompilerManager;
import com.intellij.openapi.components.ProjectComponent;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;

import org.jetbrains.haskell.compiler.HaskellCabalCompiler;

import org.jetbrains.haskell.fileType.HaskellFileType;
import org.jetbrains.haskell.fileType.HiFileType;

import java.util.Collections;
import java.util.HashSet;

public final class HaskellProjectComponent implements ProjectComponent {
    private final Project project;
   
    public HaskellProjectComponent(Project project, CompilerManager manager) {
        this.project = project;

        HashSet<FileType> inputSet = new HashSet<FileType>(Collections.singleton(HaskellFileType.INSTANCE));
        HashSet<FileType> outputSet = new HashSet<FileType>(Collections.singleton(HiFileType.INSTANCE));
        manager.addCompilableFileType(HaskellFileType.INSTANCE);
        manager.addTranslatingCompiler(new HaskellCabalCompiler(project), inputSet, outputSet);
    }

    public void projectOpened() {

    }

    public void projectClosed() {
    }

    @NotNull
    public String getComponentName() {
        return "HaskellProjectComponent";
    }

    public void initComponent() {
     
    }

    public void disposeComponent() {
     
    }
}

@@ -555,16 +555,38 @@
 HashSet;
+%0Aimport java.util.Set;
 %0A%0Apublic
@@ -656,16 +656,18 @@
 t %7B%0A    
+//
 private 
@@ -780,16 +780,18 @@
         
+//
 this.pro
@@ -819,212 +819,92 @@
     
-HashSet%3CFileType%3E inputSet = new HashSet%3CFileType%3E(Collections.singleton(HaskellFileType.INSTANCE));%0A        HashSet%3CFileType%3E outputSet = new HashSet%3CFileType%3E(Collections.singleton(HiFileType.INSTANCE))
+CompilerWorkspaceConfiguration.getInstance(project).USE_OUT_OF_PROCESS_BUILD = false
 ;%0A  
@@ -1005,16 +1005,33 @@
 ompiler(
+%0A                
 new Hask
@@ -1060,28 +1060,152 @@
 ct),
- inputSet, outputSet
+%0A                Collections.%3CFileType%3Esingleton(HaskellFileType.INSTANCE),%0A                Collections.%3CFileType%3Esingleton(HiFileType.INSTANCE)
 );%0A 

Fix compilation