Revert "Introduce @FrontendInternals annotation"
Revert due to Mobile IDE Trunk IJ TC configuration This reverts commits:ffc3d8bdfcc0e713980b^KT-39643 In Progress
This commit is contained in:
@@ -25,7 +25,6 @@ import com.intellij.psi.stubs.StringStubIndexExtension
|
||||
import com.intellij.util.indexing.IdFilter
|
||||
import org.jetbrains.kotlin.asJava.elements.KtLightElement
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.idea.FrontendInternals
|
||||
import org.jetbrains.kotlin.idea.caches.KotlinShortNamesCache
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.*
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.util.getJavaMemberDescriptor
|
||||
@@ -73,7 +72,6 @@ class KotlinIndicesHelper(
|
||||
private val project = resolutionFacade.project
|
||||
private val scopeWithoutKotlin = scope.excludeKotlinSources() as GlobalSearchScope
|
||||
|
||||
@OptIn(FrontendInternals::class)
|
||||
private val descriptorFilter: (DeclarationDescriptor) -> Boolean = filter@{
|
||||
if (resolutionFacade.frontendService<DeprecationResolver>().isHiddenInResolution(it)) return@filter false
|
||||
if (!visibilityFilter(it)) return@filter false
|
||||
@@ -473,7 +471,6 @@ class KotlinIndicesHelper(
|
||||
processor(descriptor)
|
||||
|
||||
// SAM-adapter
|
||||
@OptIn(FrontendInternals::class)
|
||||
val syntheticScopes = resolutionFacade.getFrontendService(SyntheticScopes::class.java).forceEnableSamAdapters()
|
||||
val contributedFunctions = container.staticScope.getContributedFunctions(descriptor.name, NoLookupLocation.FROM_IDE)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ReceiverParameterDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.VariableDescriptor
|
||||
import org.jetbrains.kotlin.idea.resolve.ResolutionFacade
|
||||
import org.jetbrains.kotlin.idea.resolve.getDataFlowValueFactory
|
||||
import org.jetbrains.kotlin.idea.resolve.frontendService
|
||||
import org.jetbrains.kotlin.idea.util.getImplicitReceiversWithInstance
|
||||
import org.jetbrains.kotlin.idea.util.getResolutionScope
|
||||
import org.jetbrains.kotlin.psi.KtExpression
|
||||
@@ -34,7 +34,7 @@ class SmartCastCalculator(
|
||||
receiver: KtExpression?,
|
||||
resolutionFacade: ResolutionFacade
|
||||
) {
|
||||
private val dataFlowValueFactory = resolutionFacade.getDataFlowValueFactory()
|
||||
private val dataFlowValueFactory = resolutionFacade.frontendService<DataFlowValueFactory>()
|
||||
|
||||
// keys are VariableDescriptor's and ThisReceiver's
|
||||
private val entityToSmartCastInfo: Map<Any, SmartCastInfo> = processDataFlowInfo(
|
||||
|
||||
@@ -7,7 +7,6 @@ package org.jetbrains.kotlin.idea.core
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.idea.FrontendInternals
|
||||
import org.jetbrains.kotlin.idea.analysis.computeTypeInContext
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.getResolutionFacade
|
||||
@@ -16,8 +15,6 @@ import org.jetbrains.kotlin.idea.references.mainReference
|
||||
import org.jetbrains.kotlin.idea.references.resolveToDescriptors
|
||||
import org.jetbrains.kotlin.idea.resolve.ResolutionFacade
|
||||
import org.jetbrains.kotlin.idea.resolve.frontendService
|
||||
import org.jetbrains.kotlin.idea.resolve.getDataFlowValueFactory
|
||||
import org.jetbrains.kotlin.idea.resolve.getLanguageVersionSettings
|
||||
import org.jetbrains.kotlin.idea.util.getImplicitReceiversWithInstanceToExpression
|
||||
import org.jetbrains.kotlin.idea.util.getResolutionScope
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
@@ -118,11 +115,9 @@ fun Call.resolveCandidates(
|
||||
val callResolutionContext = BasicCallResolutionContext.create(
|
||||
bindingTrace, resolutionScope, this, expectedType, dataFlowInfo,
|
||||
ContextDependency.INDEPENDENT, CheckArgumentTypesMode.CHECK_VALUE_ARGUMENTS,
|
||||
false, resolutionFacade.getLanguageVersionSettings(),
|
||||
resolutionFacade.getDataFlowValueFactory()
|
||||
false, resolutionFacade.frontendService(),
|
||||
resolutionFacade.frontendService()
|
||||
).replaceCollectAllCandidates(true)
|
||||
|
||||
@OptIn(FrontendInternals::class)
|
||||
val callResolver = resolutionFacade.frontendService<CallResolver>()
|
||||
|
||||
val results = callResolver.resolveFunctionCall(callResolutionContext)
|
||||
|
||||
@@ -15,13 +15,11 @@ import org.jetbrains.kotlin.config.LanguageFeature
|
||||
import org.jetbrains.kotlin.config.LanguageVersionSettings
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.extensions.DeclarationAttributeAltererExtension
|
||||
import org.jetbrains.kotlin.idea.FrontendInternals
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.getResolutionFacade
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.resolveToDescriptorIfAny
|
||||
import org.jetbrains.kotlin.idea.references.mainReference
|
||||
import org.jetbrains.kotlin.idea.resolve.frontendService
|
||||
import org.jetbrains.kotlin.idea.resolve.getLanguageVersionSettings
|
||||
import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers
|
||||
import org.jetbrains.kotlin.idea.util.hasJvmFieldAnnotation
|
||||
import org.jetbrains.kotlin.idea.util.isExpectDeclaration
|
||||
@@ -115,7 +113,6 @@ fun KtCallExpression.getLastLambdaExpression(): KtLambdaExpression? {
|
||||
return valueArguments.lastOrNull()?.getArgumentExpression()?.unpackFunctionLiteral()
|
||||
}
|
||||
|
||||
@OptIn(FrontendInternals::class)
|
||||
fun KtCallExpression.canMoveLambdaOutsideParentheses(): Boolean {
|
||||
if (getStrictParentOfType<KtDelegatedSuperTypeEntry>() != null) return false
|
||||
if (getLastLambdaExpression() == null) return false
|
||||
@@ -128,7 +125,7 @@ fun KtCallExpression.canMoveLambdaOutsideParentheses(): Boolean {
|
||||
val resolutionFacade = getResolutionFacade()
|
||||
val samConversionTransformer = resolutionFacade.frontendService<SamConversionResolver>()
|
||||
val samConversionOracle = resolutionFacade.frontendService<SamConversionOracle>()
|
||||
val languageVersionSettings = resolutionFacade.getLanguageVersionSettings()
|
||||
val languageVersionSettings = resolutionFacade.frontendService<LanguageVersionSettings>()
|
||||
|
||||
val bindingContext = analyze(resolutionFacade, BodyResolveMode.PARTIAL)
|
||||
val targets = bindingContext[BindingContext.REFERENCE_TARGET, callee]?.let { listOf(it) }
|
||||
|
||||
Reference in New Issue
Block a user