Simplify usages of IncrementalPackageFragment and related code

Since its scope is now empty, no descriptor now has a container that is an
instance of IncrementalPackageFragment -> a lot of code is not needed anymore
This commit is contained in:
Alexander Udalov
2016-10-03 18:45:23 +03:00
parent 7c6352a9f2
commit 53b584f48c
16 changed files with 64 additions and 128 deletions
@@ -18,7 +18,9 @@ package org.jetbrains.kotlin.annotation
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.StandardFileSystems
import com.intellij.psi.*
import com.intellij.psi.JavaPsiFacade
import com.intellij.psi.PsiJavaFile
import com.intellij.psi.PsiManager
import com.intellij.psi.impl.PsiModificationTrackerImpl
import com.intellij.psi.search.GlobalSearchScope
import org.jetbrains.kotlin.analyzer.AnalysisResult
@@ -34,7 +36,6 @@ import org.jetbrains.kotlin.fileClasses.NoResolveFileClassesProvider
import org.jetbrains.kotlin.incremental.components.SourceRetentionAnnotationHandler
import org.jetbrains.kotlin.java.model.elements.JeTypeElement
import org.jetbrains.kotlin.load.java.JvmAbi
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCompilationComponents
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.resolve.BindingTrace
import org.jetbrains.kotlin.resolve.jvm.extensions.AnalysisCompletedHandlerExtension
@@ -161,7 +162,7 @@ abstract class AbstractAnnotationProcessingExtension(
private fun KotlinProcessingEnvironment.createTypeMapper(): KotlinTypeMapper {
return KotlinTypeMapper(bindingContext, ClassBuilderMode.full(false), NoResolveFileClassesProvider,
null, IncompatibleClassTracker.DoNothing, JvmAbi.DEFAULT_MODULE_NAME, false)
IncompatibleClassTracker.DoNothing, JvmAbi.DEFAULT_MODULE_NAME, false)
}
private fun KotlinProcessingEnvironment.doAnnotationProcessing(files: Collection<KtFile>): ProcessingResult {
@@ -319,4 +320,4 @@ abstract class AbstractAnnotationProcessingExtension(
protected abstract fun loadAnnotationProcessors(): List<Processor>
}
private class ProcessingResult(val errorCount: Int, val warningCount: Int, val wasAnythingGenerated: Boolean)
private class ProcessingResult(val errorCount: Int, val warningCount: Int, val wasAnythingGenerated: Boolean)
@@ -75,7 +75,7 @@ class KotlinUClass(
override val internalName by lz {
val descriptor = resolveToDescriptor() ?: return@lz null
val typeMapper = KotlinTypeMapper(BindingContext.EMPTY, ClassBuilderMode.LIGHT_CLASSES, NoResolveFileClassesProvider, null,
val typeMapper = KotlinTypeMapper(BindingContext.EMPTY, ClassBuilderMode.LIGHT_CLASSES, NoResolveFileClassesProvider,
IncompatibleClassTracker.DoNothing, JvmAbi.DEFAULT_MODULE_NAME, false)
typeMapper.mapClass(descriptor).internalName
}
@@ -130,4 +130,4 @@ class KotlinUClass(
val bindingContext = psi.analyze(BodyResolveMode.PARTIAL)
return bindingContext[BindingContext.DECLARATION_TO_DESCRIPTOR, psi] as? ClassDescriptor
}
}
}
@@ -66,7 +66,7 @@ abstract class KotlinAbstractUFunction : KotlinAbstractUElement(), UFunction, Ps
return@lz null
}
val typeMapper = KotlinTypeMapper(BindingContext.EMPTY, ClassBuilderMode.LIGHT_CLASSES, NoResolveFileClassesProvider, null,
val typeMapper = KotlinTypeMapper(BindingContext.EMPTY, ClassBuilderMode.LIGHT_CLASSES, NoResolveFileClassesProvider,
IncompatibleClassTracker.DoNothing, JvmAbi.DEFAULT_MODULE_NAME, false)
typeMapper.mapAsmMethod(descriptor).descriptor
}
@@ -260,4 +260,4 @@ open class KotlinObjectLiteralConstructorUFunction(
get() = parent.visibility
override fun getSuperFunctions(context: UastContext) = emptyList<UFunction>()
}
}