Cleanup: when possible, do analyzeFully -> analyze

This commit is contained in:
Mikhail Glukhikh
2017-04-06 18:46:51 +03:00
parent ba04dac4b7
commit 767db68daf
2 changed files with 4 additions and 4 deletions
@@ -17,7 +17,7 @@
package org.jetbrains.kotlin.idea.intentions.copyConcatenatedStringToClipboard
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.idea.caches.resolve.analyzeFully
import org.jetbrains.kotlin.idea.caches.resolve.analyze
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.psi.psiUtil.collectDescendantsOfType
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
@@ -56,7 +56,7 @@ class ConcatenatedStringGenerator {
}
private fun KtExpression.convertToValueIfCompileTimeConstant(): String? {
val resolvedCall = getResolvedCall(analyzeFully()) ?: return null
val resolvedCall = getResolvedCall(analyze()) ?: return null
val propertyDescriptor = resolvedCall.resultingDescriptor as? PropertyDescriptor ?: return null
return propertyDescriptor.compileTimeInitializer?.value?.toString()
}
@@ -23,7 +23,7 @@ import com.intellij.psi.PsiFile
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.kotlin.diagnostics.Diagnostic
import org.jetbrains.kotlin.idea.KotlinBundle
import org.jetbrains.kotlin.idea.caches.resolve.analyzeFully
import org.jetbrains.kotlin.idea.caches.resolve.analyze
import org.jetbrains.kotlin.idea.core.ShortenReferences
import org.jetbrains.kotlin.idea.core.quickfix.QuickFixUtil
import org.jetbrains.kotlin.idea.project.builtIns
@@ -49,7 +49,7 @@ class ChangeFunctionLiteralReturnTypeFix(
private val appropriateQuickFix = createAppropriateQuickFix(functionLiteralExpression, type)
private fun createAppropriateQuickFix(functionLiteralExpression: KtLambdaExpression, type: KotlinType): IntentionAction? {
val context = functionLiteralExpression.containingKtFile.analyzeFully()
val context = functionLiteralExpression.analyze()
val functionLiteralType = context.getType(functionLiteralExpression) ?: error("Type of function literal not available in binding context")
val builtIns = functionLiteralType.constructor.builtIns