Remove redundant direct usages of the ScriptDefinition in compiler

plus some refactoring around definition extraction
This commit is contained in:
Ilya Chernikov
2019-02-13 17:57:28 +01:00
parent 5bc262fcb4
commit d1a1594f26
7 changed files with 48 additions and 47 deletions
@@ -84,6 +84,8 @@ public class ResolveSession implements KotlinCodeAnalyzer, LazyClassContext {
private final SyntheticResolveExtension syntheticResolveExtension;
private Project project;
@Inject
public void setAnnotationResolve(AnnotationResolver annotationResolver) {
this.annotationResolver = annotationResolver;
@@ -190,6 +192,8 @@ public class ResolveSession implements KotlinCodeAnalyzer, LazyClassContext {
danglingAnnotations = storageManager.createMemoizedFunction(file -> createAnnotations(file, file.getDanglingAnnotations()));
syntheticResolveExtension = SyntheticResolveExtension.Companion.getInstance(project);
this.project = project;
}
private LazyAnnotations createAnnotations(KtFile file, List<KtAnnotationEntry> annotationEntries) {
@@ -451,6 +455,11 @@ public class ResolveSession implements KotlinCodeAnalyzer, LazyClassContext {
return platformDiagnosticSuppressor;
}
@NotNull
public Project getProject() {
return project;
}
@Override
public void assertValid() {
module.assertValid();