package com.redhat.ceylon.eclipse.core.typechecker;

import java.util.List;

import org.antlr.runtime.CommonToken;

import com.redhat.ceylon.compiler.typechecker.TypeChecker;
import com.redhat.ceylon.compiler.typechecker.analyzer.ModuleManager;
import com.redhat.ceylon.compiler.typechecker.context.PhasedUnit;
import com.redhat.ceylon.compiler.typechecker.io.VirtualFile;
import com.redhat.ceylon.compiler.typechecker.model.Package;
import com.redhat.ceylon.compiler.typechecker.tree.Tree.CompilationUnit;

public class IdePhasedUnit extends PhasedUnit {

    private TypeChecker typeChecker;

    public IdePhasedUnit(VirtualFile unitFile, VirtualFile srcDir,
            CompilationUnit cu, Package p, ModuleManager moduleManager,
            TypeChecker typeChecker, List<CommonToken> tokenStream) {
        super(unitFile, srcDir, cu, p, moduleManager, typeChecker.getContext(), tokenStream);
        this.typeChecker = typeChecker;
    }
    
    public IdePhasedUnit(PhasedUnit other) {
        super(other);
        if (other instanceof IdePhasedUnit) {
            typeChecker = ((IdePhasedUnit) other).typeChecker;
        }
    }

    public TypeChecker getTypeChecker() {
        return typeChecker;
    }
}

@@ -427,16 +427,74 @@
 ackage;%0A
+import com.redhat.ceylon.compiler.typechecker.model.Unit;%0A
 import c
@@ -566,16 +566,25 @@
 %0Apublic 
+abstract 
 class Id
@@ -1278,10 +1278,54 @@
 ;%0A    %7D%0A
+    %0A    public abstract Unit createUnit();%0A
 %7D%0A

Make it abstract and redefine createUnit() as abstract