Rename: getModuleDescriptorForElement -> findModuleDescriptor
This commit is contained in:
+1
-1
@@ -53,7 +53,7 @@ public class KotlinCacheService(val project: Project) {
|
||||
return cache.getLazyResolveSession(element).resolveToElement(element)
|
||||
}
|
||||
|
||||
override fun getModuleDescriptorForElement(element: JetElement): ModuleDescriptor {
|
||||
override fun findModuleDescriptor(element: JetElement): ModuleDescriptor {
|
||||
return cache.getLazyResolveSession(element).getModuleDescriptor()
|
||||
}
|
||||
|
||||
|
||||
@@ -28,5 +28,5 @@ public trait ResolutionFacade {
|
||||
|
||||
public fun resolveToDescriptor(declaration: JetDeclaration): DeclarationDescriptor
|
||||
|
||||
public fun getModuleDescriptorForElement(element: JetElement): ModuleDescriptor
|
||||
public fun findModuleDescriptor(element: JetElement): ModuleDescriptor
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ public fun JetElement.analyze(): BindingContext {
|
||||
return getLazyResolveSession().analyze(this)
|
||||
}
|
||||
|
||||
public fun JetElement.getModuleDescriptorForElement(): ModuleDescriptor {
|
||||
return getLazyResolveSession().getModuleDescriptorForElement(this)
|
||||
public fun JetElement.findModuleDescriptor(): ModuleDescriptor {
|
||||
return getLazyResolveSession().findModuleDescriptor(this)
|
||||
}
|
||||
|
||||
public fun JetElement.getAnalysisResults(vararg extraFiles: JetFile): AnalysisResult {
|
||||
|
||||
+2
-2
@@ -35,7 +35,7 @@ import org.jetbrains.jet.lang.resolve.calls.callUtil.getResolvedCall
|
||||
import org.jetbrains.jet.lang.psi.psiUtil.getTextWithLocation
|
||||
import org.jetbrains.jet.lang.resolve.bindingContextUtil.getDataFlowInfo
|
||||
import org.jetbrains.jet.plugin.util.approximateFlexibleTypes
|
||||
import org.jetbrains.jet.plugin.caches.resolve.getModuleDescriptorForElement
|
||||
import org.jetbrains.jet.plugin.caches.resolve.findModuleDescriptor
|
||||
|
||||
public class RemoveExplicitTypeArguments : JetSelfTargetingIntention<JetTypeArgumentList>(
|
||||
"remove.explicit.type.arguments", javaClass()) {
|
||||
@@ -47,7 +47,7 @@ public class RemoveExplicitTypeArguments : JetSelfTargetingIntention<JetTypeArgu
|
||||
val context = AnalyzerFacadeWithCache.getContextForElement(callExpression)
|
||||
if (callExpression.getTypeArguments().isEmpty()) return false
|
||||
|
||||
val injector = InjectorForMacros(callExpression.getProject(), callExpression.getModuleDescriptorForElement())
|
||||
val injector = InjectorForMacros(callExpression.getProject(), callExpression.findModuleDescriptor())
|
||||
|
||||
val scope = context[BindingContext.RESOLUTION_SCOPE, callExpression]
|
||||
val originalCall = callExpression.getResolvedCall(context)
|
||||
|
||||
@@ -52,7 +52,7 @@ abstract class CompletionSessionBase(protected val configuration: CompletionSess
|
||||
protected val jetReference: JetSimpleNameReference? = position.getParent()?.getReferences()?.filterIsInstance(javaClass<JetSimpleNameReference>())?.firstOrNull()
|
||||
private val file = position.getContainingFile() as JetFile
|
||||
protected val resolveSession: ResolutionFacade = file.getLazyResolveSession()
|
||||
protected val moduleDescriptor: ModuleDescriptor = resolveSession.getModuleDescriptorForElement(file)
|
||||
protected val moduleDescriptor: ModuleDescriptor = resolveSession.findModuleDescriptor(file)
|
||||
protected val bindingContext: BindingContext? = jetReference?.let { resolveSession.analyze(it.expression) }
|
||||
protected val inDescriptor: DeclarationDescriptor? = jetReference?.let { bindingContext!!.get(BindingContext.RESOLUTION_SCOPE, it.expression)?.getContainingDeclaration() }
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ class ExpectedInfos(val bindingContext: BindingContext, val resolveSession: Reso
|
||||
false).replaceCollectAllCandidates(true)
|
||||
val callResolver = InjectorForMacros(
|
||||
callElement.getProject(),
|
||||
resolveSession.getModuleDescriptorForElement(callElement)
|
||||
resolveSession.findModuleDescriptor(callElement)
|
||||
).getCallResolver()
|
||||
val results: OverloadResolutionResults<FunctionDescriptor> = callResolver.resolveFunctionCall(callResolutionContext)
|
||||
|
||||
|
||||
@@ -306,7 +306,7 @@ public class JetPositionManager implements PositionManager {
|
||||
ResolutionFacade resolveSession = ResolvePackage.getLazyResolveSession(element);
|
||||
|
||||
GenerationState state = new GenerationState(file.getProject(), ClassBuilderFactories.THROW_EXCEPTION,
|
||||
resolveSession.getModuleDescriptorForElement(element),
|
||||
resolveSession.findModuleDescriptor(element),
|
||||
resolveSession.analyze(element),
|
||||
Collections.singletonList(file)
|
||||
);
|
||||
|
||||
@@ -73,7 +73,7 @@ public abstract class BaseJetVariableMacro extends Macro {
|
||||
}
|
||||
|
||||
ExpressionTypingComponents components =
|
||||
new InjectorForMacros(project, resolveSession.getModuleDescriptorForElement(contextExpression)).getExpressionTypingComponents();
|
||||
new InjectorForMacros(project, resolveSession.findModuleDescriptor(contextExpression)).getExpressionTypingComponents();
|
||||
|
||||
DataFlowInfo dataFlowInfo = getDataFlowInfo(bindingContext, contextExpression);
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ public class AutoImportFix(element: JetSimpleNameExpression) : JetHintAction<Jet
|
||||
|
||||
val result = ArrayList<PrioritizedFqName>()
|
||||
|
||||
val moduleDescriptor = resolveSession.getModuleDescriptorForElement(element)
|
||||
val moduleDescriptor = resolveSession.findModuleDescriptor(element)
|
||||
val indicesHelper = KotlinIndicesHelper(file.getProject(), resolveSession, searchScope, moduleDescriptor, ::isVisible)
|
||||
|
||||
if (!element.isImportDirectiveExpression() && !JetPsiUtil.isSelectorInQualified(element)) {
|
||||
|
||||
+2
-2
@@ -66,7 +66,7 @@ import org.jetbrains.jet.lang.cfg.pseudocodeTraverser.traverseFollowingInstructi
|
||||
import org.jetbrains.jet.plugin.refactoring.extractFunction.OutputValueBoxer.AsList
|
||||
import org.jetbrains.jet.plugin.refactoring.getContextForContainingDeclarationBody
|
||||
import org.jetbrains.jet.plugin.util.IdeDescriptorRenderers
|
||||
import org.jetbrains.jet.plugin.caches.resolve.getModuleDescriptorForElement
|
||||
import org.jetbrains.jet.plugin.caches.resolve.findModuleDescriptor
|
||||
|
||||
private val DEFAULT_FUNCTION_NAME = "myFun"
|
||||
private val DEFAULT_RETURN_TYPE = KotlinBuiltIns.getInstance().getUnitType()
|
||||
@@ -701,7 +701,7 @@ fun ExtractionData.performAnalysis(): AnalysisResult {
|
||||
analyzeControlFlow(
|
||||
localInstructions,
|
||||
pseudocode,
|
||||
originalFile.getModuleDescriptorForElement(),
|
||||
originalFile.findModuleDescriptor(),
|
||||
bindingContext,
|
||||
modifiedVarDescriptorsForControlFlow,
|
||||
options,
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ public class KotlinIntroduceVariableHandler extends KotlinIntroduceHandlerBase {
|
||||
|
||||
ResolutionFacade resolveSession = ResolvePackage.getLazyResolveSession(expression);
|
||||
final BindingContext bindingContext = resolveSession.analyze(expression);
|
||||
ModuleDescriptor moduleDescriptorForElement = resolveSession.getModuleDescriptorForElement(expression);
|
||||
ModuleDescriptor moduleDescriptorForElement = resolveSession.findModuleDescriptor(expression);
|
||||
final JetType expressionType = bindingContext.get(BindingContext.EXPRESSION_TYPE, expression); //can be null or error type
|
||||
JetScope scope = bindingContext.get(BindingContext.RESOLUTION_SCOPE, expression);
|
||||
if (scope != null) {
|
||||
|
||||
@@ -64,7 +64,7 @@ public abstract class AbstractLazyResolveByStubTest extends KotlinCodeInsightTes
|
||||
|
||||
private void performTest(@NotNull String path, boolean checkPrimaryConstructors, boolean checkPropertyAccessors) {
|
||||
JetFile file = (JetFile) getFile();
|
||||
ModuleDescriptor module = ResolvePackage.getModuleDescriptorForElement(file);
|
||||
ModuleDescriptor module = ResolvePackage.findModuleDescriptor(file);
|
||||
PackageViewDescriptor packageViewDescriptor = module.getPackage(new FqName("test"));
|
||||
Assert.assertNotNull(packageViewDescriptor);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user