Got rid of dependency on compiler dependencies in injector for TDA for JVM.
This commit is contained in:
@@ -33,9 +33,9 @@ import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.analyzer.AnalyzeExhaust;
|
||||
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
||||
import org.jetbrains.jet.lang.diagnostics.UnresolvedReferenceDiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.diagnostics.Diagnostic;
|
||||
import org.jetbrains.jet.lang.diagnostics.Severity;
|
||||
import org.jetbrains.jet.lang.diagnostics.UnresolvedReferenceDiagnosticFactory;
|
||||
import org.jetbrains.jet.lang.diagnostics.rendering.DefaultErrorMessages;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.resolve.AnalyzerScriptParameter;
|
||||
@@ -172,7 +172,7 @@ public class JetTestUtils {
|
||||
|
||||
public static AnalyzeExhaust analyzeFile(@NotNull JetFile namespace, @NotNull CompilerSpecialMode compilerSpecialMode) {
|
||||
return AnalyzerFacadeForJVM.analyzeOneFileWithJavaIntegration(namespace, Collections.<AnalyzerScriptParameter>emptyList(),
|
||||
CompileCompilerDependenciesTest.compilerDependenciesForTests(compilerSpecialMode, true));
|
||||
compilerSpecialMode);
|
||||
}
|
||||
|
||||
public static JetCoreEnvironment createEnvironmentWithMockJdkAndIdeaAnnotations(Disposable disposable) {
|
||||
|
||||
@@ -19,7 +19,6 @@ package org.jetbrains.jet.checkers;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.CompileCompilerDependenciesTest;
|
||||
import org.jetbrains.jet.JetLiteFixture;
|
||||
import org.jetbrains.jet.lang.diagnostics.Diagnostic;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
@@ -107,9 +106,8 @@ public class CheckerTestUtilTest extends JetLiteFixture {
|
||||
|
||||
public void test(final @NotNull PsiFile psiFile) {
|
||||
BindingContext bindingContext = AnalyzerFacadeForJVM.analyzeOneFileWithJavaIntegration(
|
||||
(JetFile) psiFile, Collections.<AnalyzerScriptParameter>emptyList(),
|
||||
CompileCompilerDependenciesTest.compilerDependenciesForTests(CompilerSpecialMode.REGULAR, true))
|
||||
.getBindingContext();
|
||||
(JetFile) psiFile,Collections.<AnalyzerScriptParameter>emptyList(), CompilerSpecialMode.REGULAR)
|
||||
.getBindingContext();
|
||||
|
||||
String expectedText = CheckerTestUtil.addDiagnosticMarkersToText(psiFile, CheckerTestUtil.getDiagnosticsIncludingSyntaxErrors(bindingContext, psiFile)).toString();
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ public class JetDiagnosticsTest extends JetLiteFixture {
|
||||
BindingContext bindingContext = AnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(
|
||||
getProject(), jetFiles, Collections.<AnalyzerScriptParameter>emptyList(),
|
||||
Predicates.<PsiFile>alwaysTrue(),
|
||||
myEnvironment.getCompilerDependencies())
|
||||
myEnvironment.getCompilerDependencies().getCompilerSpecialMode())
|
||||
.getBindingContext();
|
||||
|
||||
boolean ok = true;
|
||||
|
||||
@@ -259,7 +259,7 @@ public abstract class CodegenTestCase extends UsefulTestCase {
|
||||
myFiles.getPsiFiles(),
|
||||
myFiles.getScriptParameterTypes(),
|
||||
Predicates.<PsiFile>alwaysTrue(),
|
||||
myEnvironment.getCompilerDependencies());
|
||||
myEnvironment.getCompilerDependencies().getCompilerSpecialMode());
|
||||
analyzeExhaust.throwIfError();
|
||||
AnalyzingUtils.throwExceptionOnErrors(analyzeExhaust.getBindingContext());
|
||||
GenerationState state = new GenerationState(myEnvironment.getProject(), classBuilderFactory, analyzeExhaust, myFiles.getPsiFiles());
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package org.jetbrains.jet.codegen;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.CompileCompilerDependenciesTest;
|
||||
import org.jetbrains.jet.analyzer.AnalyzeExhaust;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.resolve.AnalyzerScriptParameter;
|
||||
@@ -37,8 +36,7 @@ public class GenerationUtils {
|
||||
|
||||
public static GenerationState compileFileGetGenerationStateForTest(JetFile psiFile, @NotNull CompilerSpecialMode compilerSpecialMode) {
|
||||
final AnalyzeExhaust analyzeExhaust = AnalyzerFacadeForJVM.analyzeOneFileWithJavaIntegrationAndCheckForErrors(
|
||||
psiFile, Collections.<AnalyzerScriptParameter>emptyList(),
|
||||
CompileCompilerDependenciesTest.compilerDependenciesForTests(compilerSpecialMode, true));
|
||||
psiFile, Collections.<AnalyzerScriptParameter>emptyList(), compilerSpecialMode);
|
||||
analyzeExhaust.throwIfError();
|
||||
GenerationState state = new GenerationState(psiFile.getProject(), ClassBuilderFactories.binaries(false), analyzeExhaust, Collections.singletonList(psiFile));
|
||||
state.compileCorrectFiles(CompilationErrorHandler.THROW_EXCEPTION);
|
||||
|
||||
@@ -90,7 +90,7 @@ public class ReadJavaBinaryClassTest extends TestCaseWithTmpdir {
|
||||
|
||||
BindingContext bindingContext = AnalyzerFacadeForJVM.analyzeOneFileWithJavaIntegrationAndCheckForErrors(
|
||||
psiFile, Collections.<AnalyzerScriptParameter>emptyList(),
|
||||
jetCoreEnvironment.getCompilerDependencies())
|
||||
jetCoreEnvironment.getCompilerDependencies().getCompilerSpecialMode())
|
||||
.getBindingContext();
|
||||
return bindingContext.get(BindingContext.FQNAME_TO_NAMESPACE_DESCRIPTOR, FqName.topLevel(Name.identifier("test")));
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public abstract class AbstractLazyResolveTest {
|
||||
protected InjectorForTopDownAnalyzerForJvm createInjectorForTDA(ModuleDescriptor module) {
|
||||
TopDownAnalysisParameters params = new TopDownAnalysisParameters(
|
||||
Predicates.<PsiFile>alwaysTrue(), false, false, Collections.<AnalyzerScriptParameter>emptyList());
|
||||
return new InjectorForTopDownAnalyzerForJvm(project, params, new BindingTraceContext(), module, compilerDependencies);
|
||||
return new InjectorForTopDownAnalyzerForJvm(project, params, new BindingTraceContext(), module, CompilerSpecialMode.JDK_HEADERS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,8 +23,6 @@ import org.jetbrains.jet.JetTestCaseBuilder;
|
||||
import org.jetbrains.jet.JetTestUtils;
|
||||
import org.jetbrains.jet.analyzer.AnalyzeExhaust;
|
||||
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.PropertyAccessorDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.PropertyDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.JetElement;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.psi.JetVisitorVoid;
|
||||
@@ -94,7 +92,7 @@ public class DescriptorRendererTest extends JetLiteFixture {
|
||||
AnalyzeExhaust analyzeExhaust =
|
||||
AnalyzerFacadeForJVM.analyzeOneFileWithJavaIntegration(
|
||||
(JetFile) psiFile, Collections.<AnalyzerScriptParameter>emptyList(),
|
||||
myEnvironment.getCompilerDependencies());
|
||||
myEnvironment.getCompilerDependencies().getCompilerSpecialMode());
|
||||
final BindingContext bindingContext = analyzeExhaust.getBindingContext();
|
||||
final List<DeclarationDescriptor> descriptors = new ArrayList<DeclarationDescriptor>();
|
||||
psiFile.acceptChildren(new JetVisitorVoid() {
|
||||
|
||||
@@ -156,7 +156,7 @@ public abstract class ExpectedResolveData {
|
||||
|
||||
AnalyzeExhaust analyzeExhaust = AnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(project, files, Collections.<AnalyzerScriptParameter>emptyList(),
|
||||
Predicates.<PsiFile>alwaysTrue(),
|
||||
jetCoreEnvironment.getCompilerDependencies());
|
||||
jetCoreEnvironment.getCompilerDependencies().getCompilerSpecialMode());
|
||||
BindingContext bindingContext = analyzeExhaust.getBindingContext();
|
||||
for (Diagnostic diagnostic : bindingContext.getDiagnostics()) {
|
||||
if (diagnostic.getFactory() instanceof UnresolvedReferenceDiagnosticFactory) {
|
||||
|
||||
@@ -68,7 +68,7 @@ public class JetDefaultModalityModifiersTest extends JetLiteFixture {
|
||||
assert aClass instanceof JetClass;
|
||||
AnalyzeExhaust bindingContext = AnalyzerFacadeForJVM.analyzeOneFileWithJavaIntegration(file,
|
||||
Collections.<AnalyzerScriptParameter>emptyList(),
|
||||
myEnvironment.getCompilerDependencies());
|
||||
myEnvironment.getCompilerDependencies().getCompilerSpecialMode());
|
||||
DeclarationDescriptor classDescriptor = bindingContext.getBindingContext().get(BindingContext.DECLARATION_TO_DESCRIPTOR, aClass);
|
||||
WritableScopeImpl scope = new WritableScopeImpl(
|
||||
libraryScope, root, RedeclarationHandler.DO_NOTHING, "JetDefaultModalityModifiersTest");
|
||||
|
||||
Reference in New Issue
Block a user