diff --git a/idea/ide-common/src/org/jetbrains/kotlin/idea/caches/resolve/resolutionApi.kt b/idea/ide-common/src/org/jetbrains/kotlin/idea/caches/resolve/resolutionApi.kt index b655a16df55..281cd2d0ddc 100644 --- a/idea/ide-common/src/org/jetbrains/kotlin/idea/caches/resolve/resolutionApi.kt +++ b/idea/ide-common/src/org/jetbrains/kotlin/idea/caches/resolve/resolutionApi.kt @@ -121,12 +121,12 @@ fun KtElement.findModuleDescriptor(): ModuleDescriptor = getResolutionFacade().m // This function is used on declarations to make analysis not only declaration itself but also it content: // body for declaration with body, initializer & accessors for properties fun KtDeclaration.analyzeWithContent(): BindingContext = - getResolutionFacade().analyzeFullyAndGetResult(listOf(this)).bindingContext + getResolutionFacade().analyzeWithAllCompilerChecks(listOf(this)).bindingContext // This function is used to make full analysis of declaration container. // All its declarations, including their content (see above), are analyzed. inline fun T.analyzeWithContent(): BindingContext where T : KtDeclarationContainer, T : KtElement = - getResolutionFacade().analyzeFullyAndGetResult(listOf(this)).bindingContext + getResolutionFacade().analyzeWithAllCompilerChecks(listOf(this)).bindingContext // NB: for statements / expressions, usually should be replaced with analyze(), // for declarations, analyzeWithContent() will do what you want. @@ -134,20 +134,20 @@ inline fun T.analyzeWithContent(): BindingContext where T : KtDeclar "Use analyzeWithContent() instead, or use just analyze()", ReplaceWith("analyze()") ) -fun KtElement.analyzeFully(): BindingContext = getResolutionFacade().analyzeFullyAndGetResult(listOf(this)).bindingContext +fun KtElement.analyzeFully(): BindingContext = getResolutionFacade().analyzeWithAllCompilerChecks(listOf(this)).bindingContext // This and next function are expected to produce the same result as compiler // for the given element and its children (including diagnostics, trace slices, descriptors, etc.) // Not recommended to call both of them without real need // See also KotlinResolveCache, KotlinResolveDataProvider fun KtFile.analyzeWithAllCompilerChecks(vararg extraFiles: KtFile): AnalysisResult = - KotlinCacheService.getInstance(project).getResolutionFacade(listOf(this) + extraFiles.toList()).analyzeFullyAndGetResult(listOf(this)) + KotlinCacheService.getInstance(project).getResolutionFacade(listOf(this) + extraFiles.toList()).analyzeWithAllCompilerChecks(listOf(this)) @Deprecated( "Use either KtFile.analyzeWithAllCompilerChecks() or KtElement.analyzeAndGetResult()", ReplaceWith("analyzeAndGetResult()") ) -fun KtElement.analyzeWithAllCompilerChecks(): AnalysisResult = getResolutionFacade().analyzeFullyAndGetResult(listOf(this)) +fun KtElement.analyzeWithAllCompilerChecks(): AnalysisResult = getResolutionFacade().analyzeWithAllCompilerChecks(listOf(this)) // this method don't check visibility and collect all descriptors with given fqName fun ResolutionFacade.resolveImportReference( diff --git a/idea/ide-common/src/org/jetbrains/kotlin/idea/resolve/ResolutionFacade.kt b/idea/ide-common/src/org/jetbrains/kotlin/idea/resolve/ResolutionFacade.kt index a84f006840c..969a1d81d47 100644 --- a/idea/ide-common/src/org/jetbrains/kotlin/idea/resolve/ResolutionFacade.kt +++ b/idea/ide-common/src/org/jetbrains/kotlin/idea/resolve/ResolutionFacade.kt @@ -32,7 +32,7 @@ interface ResolutionFacade { fun analyze(element: KtElement, bodyResolveMode: BodyResolveMode = BodyResolveMode.FULL): BindingContext fun analyze(elements: Collection, bodyResolveMode: BodyResolveMode): BindingContext - fun analyzeFullyAndGetResult(elements: Collection): AnalysisResult + fun analyzeWithAllCompilerChecks(elements: Collection): AnalysisResult fun resolveToDescriptor(declaration: KtDeclaration, bodyResolveMode: BodyResolveMode = BodyResolveMode.FULL): DeclarationDescriptor diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ResolutionFacadeImpl.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ResolutionFacadeImpl.kt index bc57be0beaa..53a5522cc7e 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ResolutionFacadeImpl.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ResolutionFacadeImpl.kt @@ -59,7 +59,7 @@ internal class ResolutionFacadeImpl( return resolveElementCache.resolveToElements(elements, bodyResolveMode) } - override fun analyzeFullyAndGetResult(elements: Collection): AnalysisResult = + override fun analyzeWithAllCompilerChecks(elements: Collection): AnalysisResult = projectFacade.getAnalysisResultsForElements(elements) override fun resolveToDescriptor(declaration: KtDeclaration, bodyResolveMode: BodyResolveMode): DeclarationDescriptor { diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluationBuilder.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluationBuilder.kt index 63980296b23..b6a89b50f7e 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluationBuilder.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluationBuilder.kt @@ -529,7 +529,7 @@ class KotlinEvaluator(val codeFragment: KtCodeFragment, val sourcePosition: Sour val filesToAnalyze = if (contextFile == null) listOf(this) else listOf(this, contextFile) val resolutionFacade = KotlinCacheService.getInstance(project).getResolutionFacade(filesToAnalyze) - val analysisResult = resolutionFacade.analyzeFullyAndGetResult(filesToAnalyze) + val analysisResult = resolutionFacade.analyzeWithAllCompilerChecks(filesToAnalyze) if (analysisResult.isError()) { exception(analysisResult.error) diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/KotlinBytecodeToolWindow.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/KotlinBytecodeToolWindow.kt index 1976afe36e9..c1f8adaa9ba 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/KotlinBytecodeToolWindow.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/KotlinBytecodeToolWindow.kt @@ -275,7 +275,7 @@ class KotlinBytecodeToolWindow(private val myProject: Project, private val toolW ): GenerationState { val resolutionFacade = ktFile.getResolutionFacade() - val bindingContextForFile = resolutionFacade.analyzeFullyAndGetResult(listOf(ktFile)).bindingContext + val bindingContextForFile = resolutionFacade.analyzeWithAllCompilerChecks(listOf(ktFile)).bindingContext val (bindingContext, toProcess) = DebuggerUtils.analyzeInlinedFunctions( resolutionFacade, ktFile, configuration.getBoolean(CommonConfigurationKeys.DISABLE_INLINE), diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/IntroduceBackingPropertyIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/IntroduceBackingPropertyIntention.kt index 4ceb730296f..1e58ec9d353 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/IntroduceBackingPropertyIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/IntroduceBackingPropertyIntention.kt @@ -40,7 +40,7 @@ class IntroduceBackingPropertyIntention : SelfTargetingIntention(KtP fun canIntroduceBackingProperty(property: KtProperty): Boolean { val name = property.name ?: return false - val bindingContext = property.getResolutionFacade().analyzeFullyAndGetResult(listOf(property)).bindingContext + val bindingContext = property.getResolutionFacade().analyzeWithAllCompilerChecks(listOf(property)).bindingContext val descriptor = bindingContext.get(BindingContext.DECLARATION_TO_DESCRIPTOR, property) as? PropertyDescriptor ?: return false if (bindingContext.get(BindingContext.BACKING_FIELD_REQUIRED, descriptor) == false) return false diff --git a/idea/src/org/jetbrains/kotlin/idea/j2k/J2kPostProcessor.kt b/idea/src/org/jetbrains/kotlin/idea/j2k/J2kPostProcessor.kt index a27be968c49..279e1b04311 100644 --- a/idea/src/org/jetbrains/kotlin/idea/j2k/J2kPostProcessor.kt +++ b/idea/src/org/jetbrains/kotlin/idea/j2k/J2kPostProcessor.kt @@ -145,7 +145,7 @@ class J2kPostProcessor(private val formatCode: Boolean) : PostProcessor { file.elementsInRange(rangeMarker.range!!).filterIsInstance() return if (elements.isNotEmpty()) - file.getResolutionFacade().analyzeFullyAndGetResult(elements).bindingContext.diagnostics + file.getResolutionFacade().analyzeWithAllCompilerChecks(elements).bindingContext.diagnostics else Diagnostics.EMPTY } diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/KotlinPullUpData.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/KotlinPullUpData.kt index 579d3023b3f..8ef00faa8e4 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/KotlinPullUpData.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/KotlinPullUpData.kt @@ -20,8 +20,8 @@ import com.intellij.psi.PsiNamedElement import org.jetbrains.kotlin.descriptors.ClassDescriptor import org.jetbrains.kotlin.descriptors.ClassKind import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor -import org.jetbrains.kotlin.idea.caches.resolve.util.getJavaClassDescriptor import org.jetbrains.kotlin.idea.caches.resolve.getResolutionFacade +import org.jetbrains.kotlin.idea.caches.resolve.util.getJavaClassDescriptor import org.jetbrains.kotlin.idea.refactoring.memberInfo.KtPsiClassWrapper import org.jetbrains.kotlin.idea.refactoring.memberInfo.getClassDescriptorIfAny import org.jetbrains.kotlin.idea.util.getResolutionScope @@ -42,7 +42,7 @@ class KotlinPullUpData(val sourceClass: KtClassOrObject, val membersToMove: Collection) { val resolutionFacade = sourceClass.getResolutionFacade() - val sourceClassContext = resolutionFacade.analyzeFullyAndGetResult(listOf(sourceClass)).bindingContext + val sourceClassContext = resolutionFacade.analyzeWithAllCompilerChecks(listOf(sourceClass)).bindingContext val sourceClassDescriptor = sourceClassContext[BindingContext.DECLARATION_TO_DESCRIPTOR, sourceClass] as ClassDescriptor diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/pushDown/KotlinPushDownProcessor.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/pushDown/KotlinPushDownProcessor.kt index 6728b980671..a78b9504a26 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/pushDown/KotlinPushDownProcessor.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/pushDown/KotlinPushDownProcessor.kt @@ -30,8 +30,8 @@ import org.jetbrains.kotlin.asJava.unwrapped import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor import org.jetbrains.kotlin.descriptors.ClassDescriptor import org.jetbrains.kotlin.descriptors.Modality -import org.jetbrains.kotlin.idea.caches.resolve.util.getJavaClassDescriptor import org.jetbrains.kotlin.idea.caches.resolve.getResolutionFacade +import org.jetbrains.kotlin.idea.caches.resolve.util.getJavaClassDescriptor import org.jetbrains.kotlin.idea.codeInsight.shorten.addToShorteningWaitSet import org.jetbrains.kotlin.idea.refactoring.memberInfo.KotlinMemberInfo import org.jetbrains.kotlin.idea.refactoring.memberInfo.KtPsiClassWrapper @@ -54,7 +54,7 @@ class KotlinPushDownContext( ) { val resolutionFacade = sourceClass.getResolutionFacade() - val sourceClassContext = resolutionFacade.analyzeFullyAndGetResult(listOf(sourceClass)).bindingContext + val sourceClassContext = resolutionFacade.analyzeWithAllCompilerChecks(listOf(sourceClass)).bindingContext val sourceClassDescriptor = sourceClassContext[BindingContext.DECLARATION_TO_DESCRIPTOR, sourceClass] as ClassDescriptor