Revert "+-JDK and -NOSTDLIB options"
This reverts commit 8222011874.
+- JDK will be restored in next commit
removal of -STDLIB was requested by Andrey Breslav
This commit is contained in:
@@ -30,7 +30,7 @@ public class GenerationState {
|
|||||||
|
|
||||||
public GenerationState(Project project, ClassBuilderFactory builderFactory) {
|
public GenerationState(Project project, ClassBuilderFactory builderFactory) {
|
||||||
this.project = project;
|
this.project = project;
|
||||||
this.standardLibrary = JetStandardLibrary.getJetStandardLibrary(project, true);
|
this.standardLibrary = JetStandardLibrary.getJetStandardLibrary(project);
|
||||||
this.factory = new ClassFileFactory(builderFactory, this);
|
this.factory = new ClassFileFactory(builderFactory, this);
|
||||||
this.intrinsics = new IntrinsicMethods(project, standardLibrary);
|
this.intrinsics = new IntrinsicMethods(project, standardLibrary);
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ public class GenerationState {
|
|||||||
|
|
||||||
public void compile(JetFile psiFile) {
|
public void compile(JetFile psiFile) {
|
||||||
final JetNamespace namespace = psiFile.getRootNamespace();
|
final JetNamespace namespace = psiFile.getRootNamespace();
|
||||||
final BindingContext bindingContext = AnalyzingUtils.getInstance(JavaDefaultImports.JAVA_DEFAULT_IMPORTS, true).analyzeNamespace(namespace, JetControlFlowDataTraceFactory.EMPTY);
|
final BindingContext bindingContext = AnalyzingUtils.getInstance(JavaDefaultImports.JAVA_DEFAULT_IMPORTS).analyzeNamespace(namespace, JetControlFlowDataTraceFactory.EMPTY);
|
||||||
AnalyzingUtils.throwExceptionOnErrors(bindingContext);
|
AnalyzingUtils.throwExceptionOnErrors(bindingContext);
|
||||||
compileCorrectNamespaces(bindingContext, Collections.singletonList(namespace));
|
compileCorrectNamespaces(bindingContext, Collections.singletonList(namespace));
|
||||||
// NamespaceCodegen codegen = forNamespace(namespace);
|
// NamespaceCodegen codegen = forNamespace(namespace);
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public class CompileSession {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final AnalyzingUtils instance = AnalyzingUtils.getInstance(JavaDefaultImports.JAVA_DEFAULT_IMPORTS, true);
|
final AnalyzingUtils instance = AnalyzingUtils.getInstance(JavaDefaultImports.JAVA_DEFAULT_IMPORTS);
|
||||||
List<JetNamespace> allNamespaces = new ArrayList<JetNamespace>(mySourceFileNamespaces);
|
List<JetNamespace> allNamespaces = new ArrayList<JetNamespace>(mySourceFileNamespaces);
|
||||||
allNamespaces.addAll(myLibrarySourceFileNamespaces);
|
allNamespaces.addAll(myLibrarySourceFileNamespaces);
|
||||||
myBindingContext = instance.analyzeNamespaces(myEnvironment.getProject(), allNamespaces, Predicates.<PsiFile>alwaysTrue(), JetControlFlowDataTraceFactory.EMPTY);
|
myBindingContext = instance.analyzeNamespaces(myEnvironment.getProject(), allNamespaces, Predicates.<PsiFile>alwaysTrue(), JetControlFlowDataTraceFactory.EMPTY);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class AnalyzerFacade {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private static final AnalyzingUtils ANALYZING_UTILS = AnalyzingUtils.getInstance(JavaDefaultImports.JAVA_DEFAULT_IMPORTS, true);
|
private static final AnalyzingUtils ANALYZING_UTILS = AnalyzingUtils.getInstance(JavaDefaultImports.JAVA_DEFAULT_IMPORTS);
|
||||||
private final static Key<CachedValue<BindingContext>> BINDING_CONTEXT = Key.create("BINDING_CONTEXT");
|
private final static Key<CachedValue<BindingContext>> BINDING_CONTEXT = Key.create("BINDING_CONTEXT");
|
||||||
private static final Object lock = new Object();
|
private static final Object lock = new Object();
|
||||||
|
|
||||||
|
|||||||
@@ -17,11 +17,7 @@ public class JetSemanticServices {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static JetSemanticServices createSemanticServices(Project project) {
|
public static JetSemanticServices createSemanticServices(Project project) {
|
||||||
return createSemanticServices(project, true);
|
return new JetSemanticServices(JetStandardLibrary.getJetStandardLibrary(project));
|
||||||
}
|
|
||||||
|
|
||||||
public static JetSemanticServices createSemanticServices(Project project, boolean loadFullLibrary) {
|
|
||||||
return new JetSemanticServices(JetStandardLibrary.getJetStandardLibrary(project, loadFullLibrary));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private final JetStandardLibrary standardLibrary;
|
private final JetStandardLibrary standardLibrary;
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ import java.util.*;
|
|||||||
* @author abreslav
|
* @author abreslav
|
||||||
*/
|
*/
|
||||||
public class AnalyzingUtils {
|
public class AnalyzingUtils {
|
||||||
public static AnalyzingUtils getInstance(@NotNull ImportingStrategy importingStrategy, boolean loadStdlib) {
|
public static AnalyzingUtils getInstance(@NotNull ImportingStrategy importingStrategy) {
|
||||||
return new AnalyzingUtils(importingStrategy, loadStdlib);
|
return new AnalyzingUtils(importingStrategy);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void checkForSyntacticErrors(@NotNull PsiElement root) {
|
public static void checkForSyntacticErrors(@NotNull PsiElement root) {
|
||||||
@@ -53,11 +53,9 @@ public class AnalyzingUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final ImportingStrategy importingStrategy;
|
private final ImportingStrategy importingStrategy;
|
||||||
private final boolean loadStdlib;
|
|
||||||
|
|
||||||
private AnalyzingUtils(ImportingStrategy importingStrategy, boolean loadStdlib) {
|
private AnalyzingUtils(ImportingStrategy importingStrategy) {
|
||||||
this.importingStrategy = importingStrategy;
|
this.importingStrategy = importingStrategy;
|
||||||
this.loadStdlib = loadStdlib;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BindingContext analyzeNamespace(@NotNull JetNamespace namespace, @NotNull JetControlFlowDataTraceFactory flowDataTraceFactory) {
|
public BindingContext analyzeNamespace(@NotNull JetNamespace namespace, @NotNull JetControlFlowDataTraceFactory flowDataTraceFactory) {
|
||||||
@@ -73,7 +71,7 @@ public class AnalyzingUtils {
|
|||||||
@NotNull Predicate<PsiFile> filesToAnalyzeCompletely,
|
@NotNull Predicate<PsiFile> filesToAnalyzeCompletely,
|
||||||
@NotNull JetControlFlowDataTraceFactory flowDataTraceFactory) {
|
@NotNull JetControlFlowDataTraceFactory flowDataTraceFactory) {
|
||||||
BindingTraceContext bindingTraceContext = new BindingTraceContext();
|
BindingTraceContext bindingTraceContext = new BindingTraceContext();
|
||||||
JetSemanticServices semanticServices = JetSemanticServices.createSemanticServices(project, loadStdlib);
|
JetSemanticServices semanticServices = JetSemanticServices.createSemanticServices(project);
|
||||||
|
|
||||||
JetScope libraryScope = semanticServices.getStandardLibrary().getLibraryScope();
|
JetScope libraryScope = semanticServices.getStandardLibrary().getLibraryScope();
|
||||||
ModuleDescriptor owner = new ModuleDescriptor("<module>");
|
ModuleDescriptor owner = new ModuleDescriptor("<module>");
|
||||||
|
|||||||
@@ -29,24 +29,16 @@ import java.util.Set;
|
|||||||
public class JetStandardLibrary {
|
public class JetStandardLibrary {
|
||||||
|
|
||||||
// TODO : consider releasing this memory
|
// TODO : consider releasing this memory
|
||||||
private static JetStandardLibrary cachedFullLibrary = null;
|
private static JetStandardLibrary cachedLibrary = null;
|
||||||
private static JetStandardLibrary cachedQuickLibrary = null;
|
|
||||||
// private static final Map<Project, JetStandardLibrary> standardLibraryCache = new HashMap<Project, JetStandardLibrary>();
|
// private static final Map<Project, JetStandardLibrary> standardLibraryCache = new HashMap<Project, JetStandardLibrary>();
|
||||||
|
|
||||||
// TODO : double checked locking
|
// TODO : double checked locking
|
||||||
synchronized
|
synchronized
|
||||||
public static JetStandardLibrary getJetStandardLibrary(@NotNull Project project, boolean loadFullLibrary) {
|
public static JetStandardLibrary getJetStandardLibrary(@NotNull Project project) {
|
||||||
if (loadFullLibrary) {
|
if (cachedLibrary == null) {
|
||||||
if (cachedFullLibrary == null) {
|
cachedLibrary = new JetStandardLibrary(project);
|
||||||
cachedFullLibrary = new JetStandardLibrary(project, true);
|
|
||||||
}
|
|
||||||
return cachedFullLibrary;
|
|
||||||
} else {
|
|
||||||
if (cachedQuickLibrary == null) {
|
|
||||||
cachedQuickLibrary = new JetStandardLibrary(project, false);
|
|
||||||
}
|
|
||||||
return cachedQuickLibrary;
|
|
||||||
}
|
}
|
||||||
|
return cachedLibrary;
|
||||||
// JetStandardLibrary standardLibrary = standardLibraryCache.get(project);
|
// JetStandardLibrary standardLibrary = standardLibraryCache.get(project);
|
||||||
// if (standardLibrary == null) {
|
// if (standardLibrary == null) {
|
||||||
// standardLibrary = new JetStandardLibrary(project);
|
// standardLibrary = new JetStandardLibrary(project);
|
||||||
@@ -55,12 +47,6 @@ public class JetStandardLibrary {
|
|||||||
// return standardLibrary;
|
// return standardLibrary;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JetStandardLibrary getJetStandardLibrary(@NotNull Project project) {
|
|
||||||
return getJetStandardLibrary(project, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
private final boolean loadFullLibrary;
|
|
||||||
|
|
||||||
private JetScope libraryScope;
|
private JetScope libraryScope;
|
||||||
|
|
||||||
private ClassDescriptor numberClass;
|
private ClassDescriptor numberClass;
|
||||||
@@ -136,27 +122,20 @@ public class JetStandardLibrary {
|
|||||||
private NamespaceDescriptor typeInfoNamespace;
|
private NamespaceDescriptor typeInfoNamespace;
|
||||||
private Set<FunctionDescriptor> typeInfoFunction;
|
private Set<FunctionDescriptor> typeInfoFunction;
|
||||||
|
|
||||||
private JetStandardLibrary(@NotNull Project project, boolean loadFullLibrary) {
|
private JetStandardLibrary(@NotNull Project project) {
|
||||||
this.loadFullLibrary = loadFullLibrary;
|
// TODO : review
|
||||||
|
InputStream stream = JetStandardClasses.class.getClassLoader().getResourceAsStream("jet/Library.jet");
|
||||||
try {
|
try {
|
||||||
JetFile file = null;
|
//noinspection IOResourceOpenedButNotSafelyClosed
|
||||||
if (loadFullLibrary) {
|
JetFile file = (JetFile) PsiFileFactory.getInstance(project).createFileFromText("Library.jet",
|
||||||
// TODO : review
|
JetFileType.INSTANCE, FileUtil.loadTextAndClose(new InputStreamReader(stream)));
|
||||||
InputStream stream = JetStandardClasses.class.getClassLoader().getResourceAsStream("jet/Library.jet");
|
|
||||||
//noinspection IOResourceOpenedButNotSafelyClosed
|
|
||||||
file = (JetFile) PsiFileFactory.getInstance(project).createFileFromText("Library.jet",
|
|
||||||
JetFileType.INSTANCE, FileUtil.loadTextAndClose(new InputStreamReader(stream)));
|
|
||||||
}
|
|
||||||
|
|
||||||
JetSemanticServices bootstrappingSemanticServices = JetSemanticServices.createSemanticServices(this);
|
JetSemanticServices bootstrappingSemanticServices = JetSemanticServices.createSemanticServices(this);
|
||||||
BindingTraceContext bindingTraceContext = new BindingTraceContext();
|
BindingTraceContext bindingTraceContext = new BindingTraceContext();
|
||||||
WritableScopeImpl writableScope = new WritableScopeImpl(JetStandardClasses.STANDARD_CLASSES, JetStandardClasses.STANDARD_CLASSES_NAMESPACE, RedeclarationHandler.THROW_EXCEPTION).setDebugName("Root bootstrap scope");
|
WritableScopeImpl writableScope = new WritableScopeImpl(JetStandardClasses.STANDARD_CLASSES, JetStandardClasses.STANDARD_CLASSES_NAMESPACE, RedeclarationHandler.THROW_EXCEPTION).setDebugName("Root bootstrap scope");
|
||||||
// this.libraryScope = bootstrappingTDA.process(JetStandardClasses.STANDARD_CLASSES, file.getRootNamespace().getDeclarations());
|
// this.libraryScope = bootstrappingTDA.process(JetStandardClasses.STANDARD_CLASSES, file.getRootNamespace().getDeclarations());
|
||||||
// bootstrappingTDA.process(writableScope, JetStandardClasses.STANDARD_CLASSES_NAMESPACE, file.getRootNamespace().getDeclarations());
|
// bootstrappingTDA.process(writableScope, JetStandardClasses.STANDARD_CLASSES_NAMESPACE, file.getRootNamespace().getDeclarations());
|
||||||
if (loadFullLibrary) {
|
TopDownAnalyzer.processStandardLibraryNamespace(bootstrappingSemanticServices, bindingTraceContext, writableScope, JetStandardClasses.STANDARD_CLASSES_NAMESPACE, file.getRootNamespace());
|
||||||
TopDownAnalyzer.processStandardLibraryNamespace(bootstrappingSemanticServices, bindingTraceContext, writableScope, JetStandardClasses.STANDARD_CLASSES_NAMESPACE, file.getRootNamespace());
|
|
||||||
}
|
|
||||||
// this.libraryScope = JetStandardClasses.STANDARD_CLASSES_NAMESPACE.getMemberScope();
|
// this.libraryScope = JetStandardClasses.STANDARD_CLASSES_NAMESPACE.getMemberScope();
|
||||||
|
|
||||||
AnalyzingUtils.throwExceptionOnErrors(bindingTraceContext.getBindingContext());
|
AnalyzingUtils.throwExceptionOnErrors(bindingTraceContext.getBindingContext());
|
||||||
@@ -174,11 +153,6 @@ public class JetStandardLibrary {
|
|||||||
private void initStdClasses() {
|
private void initStdClasses() {
|
||||||
if(libraryScope == null) {
|
if(libraryScope == null) {
|
||||||
this.libraryScope = JetStandardClasses.STANDARD_CLASSES_NAMESPACE.getMemberScope();
|
this.libraryScope = JetStandardClasses.STANDARD_CLASSES_NAMESPACE.getMemberScope();
|
||||||
|
|
||||||
if (!loadFullLibrary) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.numberClass = (ClassDescriptor) libraryScope.getClassifier("Number");
|
this.numberClass = (ClassDescriptor) libraryScope.getClassifier("Number");
|
||||||
this.byteClass = (ClassDescriptor) libraryScope.getClassifier("Byte");
|
this.byteClass = (ClassDescriptor) libraryScope.getClassifier("Byte");
|
||||||
this.charClass = (ClassDescriptor) libraryScope.getClassifier("Char");
|
this.charClass = (ClassDescriptor) libraryScope.getClassifier("Char");
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// -JDK
|
|
||||||
|
|
||||||
fun test() : Unit {
|
fun test() : Unit {
|
||||||
var x : Int? = 0
|
var x : Int? = 0
|
||||||
var y : Int = 0
|
var y : Int = 0
|
||||||
@@ -15,4 +13,4 @@ fun test() : Unit {
|
|||||||
x <!USELESS_CAST!>as?<!> Int? : Int?
|
x <!USELESS_CAST!>as?<!> Int? : Int?
|
||||||
y <!USELESS_CAST_STATIC_ASSERT_IS_FINE!>as?<!> Int? : Int?
|
y <!USELESS_CAST_STATIC_ASSERT_IS_FINE!>as?<!> Int? : Int?
|
||||||
()
|
()
|
||||||
}
|
}
|
||||||
@@ -81,7 +81,7 @@ public class CheckerTestUtilTest extends JetLiteFixture {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void test(PsiFile psiFile) {
|
public void test(PsiFile psiFile) {
|
||||||
BindingContext bindingContext = AnalyzerFacade.analyzeFileWithCache(AnalyzingUtils.getInstance(ImportingStrategy.NONE, true), (JetFile) psiFile, AnalyzerFacade.SINGLE_DECLARATION_PROVIDER);
|
BindingContext bindingContext = AnalyzerFacade.analyzeFileWithCache(AnalyzingUtils.getInstance(ImportingStrategy.NONE), (JetFile) psiFile, AnalyzerFacade.SINGLE_DECLARATION_PROVIDER);
|
||||||
String expectedText = CheckerTestUtil.addDiagnosticMarkersToText(psiFile, bindingContext).toString();
|
String expectedText = CheckerTestUtil.addDiagnosticMarkersToText(psiFile, bindingContext).toString();
|
||||||
|
|
||||||
List<CheckerTestUtil.DiagnosedRange> diagnosedRanges = Lists.newArrayList();
|
List<CheckerTestUtil.DiagnosedRange> diagnosedRanges = Lists.newArrayList();
|
||||||
|
|||||||
@@ -8,11 +8,8 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
import org.jetbrains.jet.JetLiteFixture;
|
import org.jetbrains.jet.JetLiteFixture;
|
||||||
import org.jetbrains.jet.JetTestCaseBuilder;
|
import org.jetbrains.jet.JetTestCaseBuilder;
|
||||||
import org.jetbrains.jet.lang.diagnostics.DiagnosticUtils;
|
import org.jetbrains.jet.lang.diagnostics.DiagnosticUtils;
|
||||||
import org.jetbrains.jet.lang.resolve.AnalyzingUtils;
|
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||||
import org.jetbrains.jet.lang.resolve.ImportingStrategy;
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacade;
|
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacade;
|
||||||
import org.jetbrains.jet.lang.resolve.java.JavaDefaultImports;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -45,13 +42,7 @@ public class FullJetPsiCheckerTest extends JetLiteFixture {
|
|||||||
String clearText = CheckerTestUtil.parseDiagnosedRanges(expectedText, diagnosedRanges);
|
String clearText = CheckerTestUtil.parseDiagnosedRanges(expectedText, diagnosedRanges);
|
||||||
|
|
||||||
myFile = createPsiFile(myName, clearText);
|
myFile = createPsiFile(myName, clearText);
|
||||||
|
BindingContext bindingContext = AnalyzerFacade.analyzeFileWithCache(myFile, AnalyzerFacade.SINGLE_DECLARATION_PROVIDER);
|
||||||
boolean loadStdlib = !expectedText.contains("-STDLIB");
|
|
||||||
boolean importJdk = !expectedText.contains("-JDK");
|
|
||||||
|
|
||||||
ImportingStrategy importingStrategy = importJdk ? JavaDefaultImports.JAVA_DEFAULT_IMPORTS : ImportingStrategy.NONE;
|
|
||||||
|
|
||||||
BindingContext bindingContext = AnalyzerFacade.analyzeFileWithCache(AnalyzingUtils.getInstance(importingStrategy, loadStdlib), myFile, AnalyzerFacade.SINGLE_DECLARATION_PROVIDER);
|
|
||||||
|
|
||||||
CheckerTestUtil.diagnosticsDiff(diagnosedRanges, bindingContext.getDiagnostics(), new CheckerTestUtil.DiagnosticDiffCallbacks() {
|
CheckerTestUtil.diagnosticsDiff(diagnosedRanges, bindingContext.getDiagnostics(), new CheckerTestUtil.DiagnosticDiffCallbacks() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import org.jetbrains.jet.lang.resolve.AnalyzingUtils;
|
|||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||||
import org.jetbrains.jet.lang.resolve.ImportingStrategy;
|
import org.jetbrains.jet.lang.resolve.ImportingStrategy;
|
||||||
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacade;
|
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacade;
|
||||||
import org.jetbrains.jet.lang.resolve.java.JavaDefaultImports;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -41,12 +40,7 @@ public class QuickJetPsiCheckerTest extends JetLiteFixture {
|
|||||||
|
|
||||||
createAndCheckPsiFile(name, clearText);
|
createAndCheckPsiFile(name, clearText);
|
||||||
JetFile jetFile = (JetFile) myFile;
|
JetFile jetFile = (JetFile) myFile;
|
||||||
boolean loadStdlib = !expectedText.contains("-STDLIB");
|
BindingContext bindingContext = AnalyzerFacade.analyzeFileWithCache(AnalyzingUtils.getInstance(ImportingStrategy.NONE), jetFile, AnalyzerFacade.SINGLE_DECLARATION_PROVIDER);
|
||||||
boolean importJdk = expectedText.contains("+JDK");
|
|
||||||
|
|
||||||
ImportingStrategy importingStrategy = importJdk ? JavaDefaultImports.JAVA_DEFAULT_IMPORTS : ImportingStrategy.NONE;
|
|
||||||
|
|
||||||
BindingContext bindingContext = AnalyzerFacade.analyzeFileWithCache(AnalyzingUtils.getInstance(importingStrategy, loadStdlib), jetFile, AnalyzerFacade.SINGLE_DECLARATION_PROVIDER);
|
|
||||||
|
|
||||||
CheckerTestUtil.diagnosticsDiff(diagnosedRanges, bindingContext.getDiagnostics(), new CheckerTestUtil.DiagnosticDiffCallbacks() {
|
CheckerTestUtil.diagnosticsDiff(diagnosedRanges, bindingContext.getDiagnostics(), new CheckerTestUtil.DiagnosticDiffCallbacks() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class JetResolveTest extends ExtensibleResolveTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected ExpectedResolveData getExpectedResolveData() {
|
protected ExpectedResolveData getExpectedResolveData() {
|
||||||
Project project = getProject();
|
Project project = getProject();
|
||||||
JetStandardLibrary lib = JetStandardLibrary.getJetStandardLibrary(project, true);
|
JetStandardLibrary lib = JetStandardLibrary.getJetStandardLibrary(project);
|
||||||
Map<String, DeclarationDescriptor> nameToDescriptor = new HashMap<String, DeclarationDescriptor>();
|
Map<String, DeclarationDescriptor> nameToDescriptor = new HashMap<String, DeclarationDescriptor>();
|
||||||
nameToDescriptor.put("std::Int.plus(Int)", standardFunction(lib.getInt(), "plus", lib.getIntType()));
|
nameToDescriptor.put("std::Int.plus(Int)", standardFunction(lib.getInt(), "plus", lib.getIntType()));
|
||||||
FunctionDescriptor descriptorForGet = standardFunction(lib.getArray(), Collections.singletonList(new TypeProjection(lib.getIntType())), "get", lib.getIntType());
|
FunctionDescriptor descriptorForGet = standardFunction(lib.getArray(), Collections.singletonList(new TypeProjection(lib.getIntType())), "get", lib.getIntType());
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ public class JetCompiler implements TranslatingCompiler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BindingContext bindingContext = AnalyzingUtils.getInstance(JavaDefaultImports.JAVA_DEFAULT_IMPORTS, true).analyzeNamespaces(
|
BindingContext bindingContext = AnalyzingUtils.getInstance(JavaDefaultImports.JAVA_DEFAULT_IMPORTS).analyzeNamespaces(
|
||||||
compileContext.getProject(), namespaces,
|
compileContext.getProject(), namespaces,
|
||||||
Predicates.<PsiFile>alwaysTrue(),
|
Predicates.<PsiFile>alwaysTrue(),
|
||||||
JetControlFlowDataTraceFactory.EMPTY);
|
JetControlFlowDataTraceFactory.EMPTY);
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ public class JavaElementFinder extends PsiElementFinder {
|
|||||||
|
|
||||||
|
|
||||||
if (dirty.size() > 0) {
|
if (dirty.size() > 0) {
|
||||||
final BindingContext context = AnalyzingUtils.getInstance(JavaDefaultImports.JAVA_DEFAULT_IMPORTS, true).shallowAnalyzeFiles(dirty);
|
final BindingContext context = AnalyzingUtils.getInstance(JavaDefaultImports.JAVA_DEFAULT_IMPORTS).shallowAnalyzeFiles(dirty);
|
||||||
state.compileCorrectNamespaces(context, AnalyzingUtils.collectRootNamespaces(dirty));
|
state.compileCorrectNamespaces(context, AnalyzingUtils.collectRootNamespaces(dirty));
|
||||||
state.getFactory().files();
|
state.getFactory().files();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user