From 954120fe3e9062dfc3c76dfdf18c4e1d2068a1ef Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Thu, 22 Dec 2011 15:53:34 +0300 Subject: [PATCH] KT-812 --- .../jet/plugin/internal/codewindow/BytecodeToolwindow.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/idea/src/org/jetbrains/jet/plugin/internal/codewindow/BytecodeToolwindow.java b/idea/src/org/jetbrains/jet/plugin/internal/codewindow/BytecodeToolwindow.java index 31992d30e86..b61555fb38b 100644 --- a/idea/src/org/jetbrains/jet/plugin/internal/codewindow/BytecodeToolwindow.java +++ b/idea/src/org/jetbrains/jet/plugin/internal/codewindow/BytecodeToolwindow.java @@ -27,6 +27,8 @@ import org.jetbrains.jet.codegen.ClassFileFactory; import org.jetbrains.jet.codegen.GenerationState; import org.jetbrains.jet.lang.psi.JetFile; import org.jetbrains.jet.lang.resolve.AnalyzingUtils; +import org.jetbrains.jet.lang.resolve.BindingContext; +import org.jetbrains.jet.plugin.compiler.WholeProjectAnalyzerFacade; import javax.swing.*; import java.awt.*; @@ -178,8 +180,9 @@ public class BytecodeToolwindow extends JPanel { protected String generateToText(JetFile file) { GenerationState state = new GenerationState(myProject, ClassBuilderFactory.TEXT); try { - AnalyzingUtils.checkForSyntacticErrors(file); - state.compile(file); + BindingContext binding = WholeProjectAnalyzerFacade.analyzeProjectWithCacheOnAFile(file); + AnalyzingUtils.throwExceptionOnErrors(binding); + state.compileCorrectNamespaces(binding, Collections.singletonList(file.getRootNamespace())); } catch (Exception e) { StringWriter out = new StringWriter(1024); e.printStackTrace(new PrintWriter(out));