JetElement.getContainingJetFile() introduced
This commit is contained in:
+1
-1
@@ -95,7 +95,7 @@ public class IDELightClassGenerationSupport extends LightClassGenerationSupport
|
||||
@NotNull
|
||||
@Override
|
||||
public LightClassConstructionContext getContextForClassOrObject(@NotNull JetClassOrObject classOrObject) {
|
||||
ResolveSessionForBodies session = AnalyzerFacadeWithCache.getLazyResolveSessionForFile((JetFile) classOrObject.getContainingFile());
|
||||
ResolveSessionForBodies session = AnalyzerFacadeWithCache.getLazyResolveSessionForFile(classOrObject.getContainingJetFile());
|
||||
|
||||
if (JetPsiUtil.isLocal(classOrObject)) {
|
||||
BindingContext bindingContext = session.resolveToElement(classOrObject);
|
||||
|
||||
@@ -28,13 +28,13 @@ public class KotlinCacheManagerUtil {
|
||||
|
||||
@NotNull
|
||||
public static KotlinDeclarationsCache getDeclarationsFromProject(@NotNull JetElement element) {
|
||||
JetFile jetFile = (JetFile) element.getContainingFile();
|
||||
JetFile jetFile = element.getContainingJetFile();
|
||||
return KotlinCacheManager.getInstance(jetFile.getProject()).getDeclarationsFromProject(TargetPlatformDetector.getPlatform(jetFile));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static BindingContext getDeclarationsBindingContext(@NotNull JetElement element) {
|
||||
JetFile jetFile = (JetFile) element.getContainingFile();
|
||||
JetFile jetFile = element.getContainingJetFile();
|
||||
KotlinDeclarationsCache declarationsCache = KotlinCacheManager.getInstance(jetFile.getProject())
|
||||
.getDeclarationsFromProject(TargetPlatformDetector.getPlatform(jetFile));
|
||||
return declarationsCache.getBindingContext();
|
||||
|
||||
@@ -63,7 +63,7 @@ class KotlinResolveCache(
|
||||
|
||||
try {
|
||||
for (element in task!!.elements) {
|
||||
val file = element.getContainingFile() as JetFile
|
||||
val file = element.getContainingJetFile()
|
||||
val virtualFile = file.getVirtualFile()
|
||||
if (LightClassUtil.belongsToKotlinBuiltIns(file)
|
||||
|| virtualFile != null && LibraryUtil.findLibraryEntry(virtualFile, file.getProject()) != null) {
|
||||
|
||||
@@ -94,7 +94,7 @@ public abstract class OverrideImplementMethodsHandler implements LanguageCodeIns
|
||||
}
|
||||
|
||||
List<JetElement> elementsToCompact = new ArrayList<JetElement>();
|
||||
JetFile file = (JetFile) classOrObject.getContainingFile();
|
||||
JetFile file = classOrObject.getContainingJetFile();
|
||||
for (JetElement element : generateOverridingMembers(selectedElements, file)) {
|
||||
PsiElement added = body.addAfter(element, afterAnchor);
|
||||
afterAnchor = added;
|
||||
|
||||
@@ -25,7 +25,7 @@ public object ShortenReferences {
|
||||
}
|
||||
|
||||
public fun process(elements: Iterable<JetElement>) {
|
||||
for ((file, fileElements) in elements.groupBy { element -> element.getContainingFile() as JetFile }) {
|
||||
for ((file, fileElements) in elements.groupBy { element -> element.getContainingJetFile() }) {
|
||||
// first resolve all qualified references - optimization
|
||||
val referenceToContext = JetFileReferencesResolver.resolve(file, fileElements, visitShortNames = false)
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public class JetPackagesContributor extends CompletionContributor {
|
||||
result = result.withPrefixMatcher(new PlainPrefixMatcher(name.substring(0, prefixLength)));
|
||||
|
||||
ResolveSessionForBodies resolveSession = AnalyzerFacadeWithCache
|
||||
.getLazyResolveSessionForFile((JetFile) simpleNameReference.getExpression().getContainingFile());
|
||||
.getLazyResolveSessionForFile(simpleNameReference.getExpression().getContainingJetFile());
|
||||
BindingContext bindingContext = resolveSession.resolveToElement(simpleNameReference.getExpression());
|
||||
|
||||
for (LookupElement variant : DescriptorLookupConverter.collectLookupElements(
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class MoveLambdaInsideParenthesesIntention : JetSelfTargetingIntention<Je
|
||||
}
|
||||
}
|
||||
if (element.getValueArguments().any { it?.getArgumentName() != null}) {
|
||||
val context = AnalyzerFacadeWithCache.analyzeFileWithCache(element.getContainingFile() as JetFile).getBindingContext()
|
||||
val context = AnalyzerFacadeWithCache.analyzeFileWithCache(element.getContainingJetFile()).getBindingContext()
|
||||
val resolvedCall = context[BindingContext.RESOLVED_CALL, element.getCalleeExpression()]
|
||||
val literalName = resolvedCall?.getResultingDescriptor()?.getValueParameters()?.last?.getName().toString()
|
||||
sb.append("$literalName = ")
|
||||
|
||||
@@ -43,7 +43,7 @@ public class RemoveExplicitTypeArguments : JetSelfTargetingIntention<JetCallExpr
|
||||
val context = AnalyzerFacadeWithCache.getContextForElement(element)
|
||||
if (element.getTypeArguments().isEmpty()) return false
|
||||
|
||||
val resolveSession = AnalyzerFacadeWithCache.getLazyResolveSessionForFile((element.getContainingFile() as JetFile))
|
||||
val resolveSession = AnalyzerFacadeWithCache.getLazyResolveSessionForFile(element.getContainingJetFile())
|
||||
val injector = InjectorForMacros(element.getProject(), resolveSession.getModuleDescriptor())
|
||||
|
||||
val scope = context[BindingContext.RESOLUTION_SCOPE, element]
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ public class ReplaceWithInfixFunctionCallIntention : JetSelfTargetingIntention<J
|
||||
numOfTotalValueArguments == 1 &&
|
||||
callee != null) {
|
||||
if (valueArguments?.getArguments()?.size() == 1 && valueArguments?.getArguments()?.first()?.isNamed() ?: false) {
|
||||
val file: JetFile = element.getContainingFile() as JetFile
|
||||
val file: JetFile = element.getContainingJetFile()
|
||||
val bindingContext = AnalyzerFacadeWithCache.analyzeFileWithCache(file).getBindingContext()
|
||||
val descriptor = bindingContext.get(BindingContext.RESOLVED_CALL, callee)
|
||||
val valueArgumentsMap = descriptor?.getValueArguments()
|
||||
|
||||
@@ -140,7 +140,7 @@ public class SpecifyTypeExplicitlyAction extends PsiElementBaseIntentionAction {
|
||||
|
||||
|
||||
private static boolean hasPublicMemberDiagnostic(@NotNull JetNamedDeclaration declaration) {
|
||||
BindingContext bindingContext = AnalyzerFacadeWithCache.analyzeFileWithCache((JetFile) declaration.getContainingFile()).getBindingContext();
|
||||
BindingContext bindingContext = AnalyzerFacadeWithCache.analyzeFileWithCache(declaration.getContainingJetFile()).getBindingContext();
|
||||
for (Diagnostic diagnostic : bindingContext.getDiagnostics()) {
|
||||
//noinspection ConstantConditions
|
||||
if (Errors.PUBLIC_MEMBER_SHOULD_SPECIFY_TYPE == diagnostic.getFactory() && declaration == diagnostic.getPsiElement()) {
|
||||
@@ -152,7 +152,7 @@ public class SpecifyTypeExplicitlyAction extends PsiElementBaseIntentionAction {
|
||||
|
||||
@NotNull
|
||||
public static JetType getTypeForDeclaration(@NotNull JetNamedDeclaration declaration) {
|
||||
BindingContext bindingContext = AnalyzerFacadeWithCache.analyzeFileWithCache((JetFile) declaration.getContainingFile()).getBindingContext();
|
||||
BindingContext bindingContext = AnalyzerFacadeWithCache.analyzeFileWithCache(declaration.getContainingJetFile()).getBindingContext();
|
||||
DeclarationDescriptor descriptor = bindingContext.get(BindingContext.DECLARATION_TO_DESCRIPTOR, declaration);
|
||||
|
||||
JetType type;
|
||||
|
||||
@@ -29,13 +29,13 @@ fun specifyTypeExplicitly(declaration: JetNamedFunction, typeReference: JetTypeR
|
||||
}
|
||||
|
||||
fun expressionType(expression: JetExpression): JetType? {
|
||||
val resolveSession = AnalyzerFacadeWithCache.getLazyResolveSessionForFile(expression.getContainingFile() as JetFile)
|
||||
val resolveSession = AnalyzerFacadeWithCache.getLazyResolveSessionForFile(expression.getContainingJetFile())
|
||||
val bindingContext = resolveSession.resolveToElement(expression)
|
||||
return bindingContext.get(BindingContext.EXPRESSION_TYPE, expression)
|
||||
}
|
||||
|
||||
fun functionReturnType(function: JetNamedFunction): JetType? {
|
||||
val resolveSession = AnalyzerFacadeWithCache.getLazyResolveSessionForFile(function.getContainingFile() as JetFile)
|
||||
val resolveSession = AnalyzerFacadeWithCache.getLazyResolveSessionForFile(function.getContainingJetFile())
|
||||
val bindingContext = resolveSession.resolveToElement(function)
|
||||
val descriptor = bindingContext.get(BindingContext.DECLARATION_TO_DESCRIPTOR, function)
|
||||
if (descriptor == null) return null
|
||||
|
||||
@@ -105,7 +105,7 @@ public class JetSourceNavigationHelper {
|
||||
|
||||
@NotNull
|
||||
private static GlobalSearchScope createLibrarySourcesScope(@NotNull JetNamedDeclaration decompiledDeclaration) {
|
||||
JetFile containingFile = (JetFile) decompiledDeclaration.getContainingFile();
|
||||
JetFile containingFile = decompiledDeclaration.getContainingJetFile();
|
||||
VirtualFile libraryFile = containingFile.getVirtualFile();
|
||||
if (libraryFile == null) {
|
||||
return GlobalSearchScope.EMPTY_SCOPE;
|
||||
@@ -348,7 +348,7 @@ public class JetSourceNavigationHelper {
|
||||
|
||||
@Nullable
|
||||
public static PsiClass getOriginalPsiClassOrCreateLightClass(@NotNull JetClassOrObject classOrObject) {
|
||||
if (LightClassUtil.belongsToKotlinBuiltIns((JetFile) classOrObject.getContainingFile())) {
|
||||
if (LightClassUtil.belongsToKotlinBuiltIns(classOrObject.getContainingJetFile())) {
|
||||
Name className = classOrObject.getNameAsName();
|
||||
assert className != null : "Class from BuiltIns should have a name";
|
||||
ClassDescriptor classDescriptor = KotlinBuiltIns.getInstance().getBuiltInClassByName(className);
|
||||
@@ -374,7 +374,7 @@ public class JetSourceNavigationHelper {
|
||||
}
|
||||
String fqName = JvmClassName.byInternalName(internalName).getFqNameForClassNameWithoutDollars().asString();
|
||||
|
||||
JetFile file = (JetFile) classOrObject.getContainingFile();
|
||||
JetFile file = classOrObject.getContainingJetFile();
|
||||
|
||||
VirtualFile vFile = file.getVirtualFile();
|
||||
Project project = file.getProject();
|
||||
|
||||
+1
-1
@@ -380,7 +380,7 @@ public class JetFunctionParameterInfoHandler implements ParameterInfoHandlerWith
|
||||
}
|
||||
|
||||
ResolveSessionForBodies resolveSession =
|
||||
AnalyzerFacadeWithCache.getLazyResolveSessionForFile((JetFile) callNameExpression.getContainingFile());
|
||||
AnalyzerFacadeWithCache.getLazyResolveSessionForFile(callNameExpression.getContainingJetFile());
|
||||
BindingContext bindingContext = resolveSession.resolveToElement(callNameExpression);
|
||||
|
||||
JetScope scope = bindingContext.get(BindingContext.RESOLUTION_SCOPE, callNameExpression);
|
||||
|
||||
@@ -53,7 +53,7 @@ public final class AnalyzerFacadeWithCache {
|
||||
|
||||
@NotNull
|
||||
public static BindingContext getContextForElement(@NotNull JetElement jetElement) {
|
||||
ResolveSessionForBodies resolveSessionForBodies = getLazyResolveSessionForFile((JetFile) jetElement.getContainingFile());
|
||||
ResolveSessionForBodies resolveSessionForBodies = getLazyResolveSessionForFile(jetElement.getContainingJetFile());
|
||||
return resolveSessionForBodies.resolveToElement(jetElement);
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ public class ResolveElementCache {
|
||||
BindingTrace trace = resolveSession.getStorageManager().createSafeTrace(
|
||||
new DelegatingBindingTrace(resolveSession.getBindingContext(), "trace to resolve element", resolveElement));
|
||||
|
||||
JetFile file = (JetFile) resolveElement.getContainingFile();
|
||||
JetFile file = resolveElement.getContainingJetFile();
|
||||
|
||||
if (resolveElement instanceof JetNamedFunction) {
|
||||
functionAdditionalResolve(resolveSession, (JetNamedFunction) resolveElement, trace, file);
|
||||
@@ -144,7 +144,7 @@ public class ResolveElementCache {
|
||||
}
|
||||
else if (resolveElement instanceof JetImportDirective) {
|
||||
JetImportDirective importDirective = (JetImportDirective) resolveElement;
|
||||
LazyImportScope scope = resolveSession.getScopeProvider().getExplicitImportsScopeForFile((JetFile) importDirective.getContainingFile());
|
||||
LazyImportScope scope = resolveSession.getScopeProvider().getExplicitImportsScopeForFile(importDirective.getContainingJetFile());
|
||||
scope.forceResolveAllContents();
|
||||
}
|
||||
else if (resolveElement instanceof JetAnnotationEntry) {
|
||||
@@ -346,7 +346,7 @@ public class ResolveElementCache {
|
||||
ScopeProvider provider = resolveSession.getScopeProvider();
|
||||
JetDeclaration parentDeclaration = PsiTreeUtil.getParentOfType(expression, JetDeclaration.class);
|
||||
if (parentDeclaration == null) {
|
||||
return provider.getFileScope((JetFile) expression.getContainingFile());
|
||||
return provider.getFileScope(expression.getContainingJetFile());
|
||||
}
|
||||
return provider.getResolutionScopeForDeclaration(parentDeclaration);
|
||||
}
|
||||
@@ -380,7 +380,7 @@ public class ResolveElementCache {
|
||||
|
||||
if (expression.getParent() instanceof JetDotQualifiedExpression) {
|
||||
JetExpression element = ((JetDotQualifiedExpression) expression.getParent()).getReceiverExpression();
|
||||
FqName fqName = ((JetFile) expression.getContainingFile()).getPackageFqName();
|
||||
FqName fqName = expression.getContainingJetFile().getPackageFqName();
|
||||
|
||||
PackageViewDescriptor filePackage = resolveSession.getModuleDescriptor().getPackage(fqName);
|
||||
assert filePackage != null : "File package should be already resolved and be found";
|
||||
|
||||
@@ -59,7 +59,7 @@ public class JetClassOrObjectTreeNode extends AbstractPsiBasedNode<JetClassOrObj
|
||||
data.setPresentableText(classOrObject.getName());
|
||||
|
||||
AbstractTreeNode parent = getParent();
|
||||
if (JetIconProvider.getMainClass((JetFile) classOrObject.getContainingFile()) != null) {
|
||||
if (JetIconProvider.getMainClass(classOrObject.getContainingJetFile()) != null) {
|
||||
if (parent instanceof JetFileTreeNode) {
|
||||
update(parent.getParent());
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class AddNameToArgumentFix extends JetIntentionAction<JetValueArgument> {
|
||||
JetExpression callee = callElement.getCalleeExpression();
|
||||
if (!(callee instanceof JetReferenceExpression)) return Collections.emptyList();
|
||||
|
||||
BindingContext context = AnalyzerFacadeWithCache.analyzeFileWithCache((JetFile) argument.getContainingFile()).getBindingContext();
|
||||
BindingContext context = AnalyzerFacadeWithCache.analyzeFileWithCache(argument.getContainingJetFile()).getBindingContext();
|
||||
ResolvedCall<?> resolvedCall = context.get(BindingContext.RESOLVED_CALL, (JetReferenceExpression) callee);
|
||||
if (resolvedCall == null) return Collections.emptyList();
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ public class AutoImportFix extends JetHintAction<JetSimpleNameExpression> implem
|
||||
}
|
||||
|
||||
ResolveSessionForBodies resolveSessionForBodies =
|
||||
AnalyzerFacadeWithCache.getLazyResolveSessionForFile((JetFile) element.getContainingFile());
|
||||
AnalyzerFacadeWithCache.getLazyResolveSessionForFile(element.getContainingJetFile());
|
||||
|
||||
List<FqName> result = Lists.newArrayList();
|
||||
if (!isSuppressedTopLevelImportInPosition(element)) {
|
||||
|
||||
@@ -50,7 +50,7 @@ public class ChangeFunctionLiteralReturnTypeFix extends JetIntentionAction<JetFu
|
||||
renderedType = DescriptorRenderer.SHORT_NAMES_IN_TYPES.renderType(type);
|
||||
functionLiteralReturnTypeRef = element.getFunctionLiteral().getReturnTypeRef();
|
||||
|
||||
BindingContext context = AnalyzerFacadeWithCache.analyzeFileWithCache((JetFile) element.getContainingFile()).getBindingContext();
|
||||
BindingContext context = AnalyzerFacadeWithCache.analyzeFileWithCache(element.getContainingJetFile()).getBindingContext();
|
||||
JetType functionLiteralType = context.get(BindingContext.EXPRESSION_TYPE, element);
|
||||
assert functionLiteralType != null : "Type of function literal not available in binding context";
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ public class ChangeFunctionReturnTypeFix extends JetIntentionAction<JetFunction>
|
||||
public IntentionAction createAction(Diagnostic diagnostic) {
|
||||
JetExpression expression = QuickFixUtil.getParentElementOfType(diagnostic, JetExpression.class);
|
||||
assert expression != null : "HAS_NEXT_FUNCTION_TYPE_MISMATCH reported on element that is not within any expression";
|
||||
BindingContext context = AnalyzerFacadeWithCache.analyzeFileWithCache((JetFile) expression.getContainingFile()).getBindingContext();
|
||||
BindingContext context = AnalyzerFacadeWithCache.analyzeFileWithCache(expression.getContainingJetFile()).getBindingContext();
|
||||
ResolvedCall<FunctionDescriptor> resolvedCall = context.get(BindingContext.LOOP_RANGE_HAS_NEXT_RESOLVED_CALL, expression);
|
||||
if (resolvedCall == null) return null;
|
||||
JetFunction hasNextFunction = (JetFunction) BindingContextUtils.descriptorToDeclaration(context, resolvedCall.getCandidateDescriptor());
|
||||
@@ -184,7 +184,7 @@ public class ChangeFunctionReturnTypeFix extends JetIntentionAction<JetFunction>
|
||||
public IntentionAction createAction(Diagnostic diagnostic) {
|
||||
JetBinaryExpression expression = QuickFixUtil.getParentElementOfType(diagnostic, JetBinaryExpression.class);
|
||||
assert expression != null : "COMPARE_TO_TYPE_MISMATCH reported on element that is not within any expression";
|
||||
BindingContext context = AnalyzerFacadeWithCache.analyzeFileWithCache((JetFile) expression.getContainingFile()).getBindingContext();
|
||||
BindingContext context = AnalyzerFacadeWithCache.analyzeFileWithCache(expression.getContainingJetFile()).getBindingContext();
|
||||
ResolvedCall<?> resolvedCall = context.get(BindingContext.RESOLVED_CALL, expression.getOperationReference());
|
||||
if (resolvedCall == null) return null;
|
||||
PsiElement compareTo = BindingContextUtils.descriptorToDeclaration(context, resolvedCall.getCandidateDescriptor());
|
||||
|
||||
@@ -164,7 +164,7 @@ public abstract class ChangeFunctionSignatureFix extends JetIntentionAction<PsiE
|
||||
(DiagnosticWithParameters2<JetFunctionLiteral, Integer, List<JetType>>) diagnostic;
|
||||
JetFunctionLiteral functionLiteral = diagnosticWithParameters.getPsiElement();
|
||||
BindingContext bindingContext =
|
||||
AnalyzerFacadeWithCache.analyzeFileWithCache((JetFile) functionLiteral.getContainingFile()).getBindingContext();
|
||||
AnalyzerFacadeWithCache.analyzeFileWithCache(functionLiteral.getContainingJetFile()).getBindingContext();
|
||||
DeclarationDescriptor descriptor = bindingContext.get(BindingContext.DECLARATION_TO_DESCRIPTOR, functionLiteral);
|
||||
|
||||
if (descriptor instanceof FunctionDescriptor) {
|
||||
|
||||
@@ -109,7 +109,7 @@ public class ChangeVariableTypeFix extends JetIntentionAction<JetVariableDeclara
|
||||
@Override
|
||||
public IntentionAction createAction(Diagnostic diagnostic) {
|
||||
JetMultiDeclarationEntry entry = ChangeFunctionReturnTypeFix.getMultiDeclarationEntryThatTypeMismatchComponentFunction(diagnostic);
|
||||
BindingContext context = AnalyzerFacadeWithCache.analyzeFileWithCache((JetFile) entry.getContainingFile()).getBindingContext();
|
||||
BindingContext context = AnalyzerFacadeWithCache.analyzeFileWithCache(entry.getContainingJetFile()).getBindingContext();
|
||||
ResolvedCall<FunctionDescriptor> resolvedCall = context.get(BindingContext.COMPONENT_RESOLVED_CALL, entry);
|
||||
if (resolvedCall == null) return null;
|
||||
JetFunction componentFunction = (JetFunction) BindingContextUtils.descriptorToDeclaration(context, resolvedCall.getCandidateDescriptor());
|
||||
@@ -130,7 +130,7 @@ public class ChangeVariableTypeFix extends JetIntentionAction<JetVariableDeclara
|
||||
|
||||
JetProperty property = QuickFixUtil.getParentElementOfType(diagnostic, JetProperty.class);
|
||||
if (property != null) {
|
||||
BindingContext context = AnalyzerFacadeWithCache.analyzeFileWithCache((JetFile) property.getContainingFile()).getBindingContext();
|
||||
BindingContext context = AnalyzerFacadeWithCache.analyzeFileWithCache(property.getContainingJetFile()).getBindingContext();
|
||||
JetType lowerBoundOfOverriddenPropertiesTypes = QuickFixUtil.findLowerBoundOfOverriddenCallablesReturnTypes(context, property);
|
||||
|
||||
DeclarationDescriptor descriptor = context.get(BindingContext.DECLARATION_TO_DESCRIPTOR, property);
|
||||
|
||||
@@ -102,7 +102,7 @@ public class QuickFixUtil {
|
||||
|
||||
@Nullable
|
||||
public static JetParameterList getParameterListOfCallee(@NotNull JetCallExpression callExpression) {
|
||||
BindingContext context = AnalyzerFacadeWithCache.analyzeFileWithCache((JetFile) callExpression.getContainingFile()).getBindingContext();
|
||||
BindingContext context = AnalyzerFacadeWithCache.analyzeFileWithCache(callExpression.getContainingJetFile()).getBindingContext();
|
||||
ResolvedCall<?> resolvedCall = context.get(BindingContext.RESOLVED_CALL, callExpression.getCalleeExpression());
|
||||
if (resolvedCall == null) return null;
|
||||
PsiElement declaration = BindingContextUtils.descriptorToDeclaration(context, resolvedCall.getCandidateDescriptor());
|
||||
|
||||
@@ -254,7 +254,7 @@ public class KotlinInlineValHandler extends InlineActionHandler {
|
||||
}
|
||||
|
||||
private static void addFunctionLiteralParameterTypes(@NotNull String parameters, @NotNull List<JetExpression> inlinedExpressions) {
|
||||
JetFile containingFile = (JetFile) inlinedExpressions.get(0).getContainingFile();
|
||||
JetFile containingFile = inlinedExpressions.get(0).getContainingJetFile();
|
||||
List<JetFunctionLiteralExpression> functionsToAddParameters = Lists.newArrayList();
|
||||
|
||||
ResolveSessionForBodies resolveSessionForBodies = AnalyzerFacadeWithCache.getLazyResolveSessionForFile(containingFile);
|
||||
@@ -314,7 +314,7 @@ public class KotlinInlineValHandler extends InlineActionHandler {
|
||||
}
|
||||
|
||||
private static void addTypeArguments(@NotNull String typeArguments, @NotNull List<JetExpression> inlinedExpressions) {
|
||||
JetFile containingFile = (JetFile) inlinedExpressions.get(0).getContainingFile();
|
||||
JetFile containingFile = inlinedExpressions.get(0).getContainingJetFile();
|
||||
List<JetCallExpression> callsToAddArguments = Lists.newArrayList();
|
||||
|
||||
ResolveSessionForBodies resolveSessionForBodies = AnalyzerFacadeWithCache.getLazyResolveSessionForFile(containingFile);
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ public class KotlinIntroduceVariableHandler extends KotlinIntroduceHandlerBase {
|
||||
}
|
||||
}
|
||||
ResolveSessionForBodies resolveSession =
|
||||
AnalyzerFacadeWithCache.getLazyResolveSessionForFile((JetFile) expression.getContainingFile());
|
||||
AnalyzerFacadeWithCache.getLazyResolveSessionForFile(expression.getContainingJetFile());
|
||||
BindingContext bindingContext = resolveSession.resolveToElement(expression);
|
||||
final JetType expressionType = bindingContext.get(BindingContext.EXPRESSION_TYPE, expression); //can be null or error type
|
||||
JetScope scope = bindingContext.get(BindingContext.RESOLUTION_SCOPE, expression);
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ import java.util.List;
|
||||
public class KotlinMoveFilesOrDirectoriesHandler extends MoveFilesOrDirectoriesHandler {
|
||||
public static boolean isMovableClass(JetClassOrObject clazz) {
|
||||
if (!(clazz.getParent() instanceof JetFile)) return false;
|
||||
JetFile file = (JetFile) clazz.getContainingFile();
|
||||
JetFile file = clazz.getContainingJetFile();
|
||||
List<JetDeclaration> declarations = file.getDeclarations();
|
||||
for (JetDeclaration declaration : declarations) {
|
||||
if (declaration instanceof JetClassOrObject && declaration != clazz) return false;
|
||||
|
||||
@@ -50,7 +50,7 @@ public class RenameJetClassProcessor extends RenamePsiElementProcessor {
|
||||
JetClassOrObject classOrObject = getJetClassOrObject(element, false, null);
|
||||
|
||||
if (classOrObject != null) {
|
||||
JetFile file = (JetFile) classOrObject.getContainingFile();
|
||||
JetFile file = classOrObject.getContainingJetFile();
|
||||
|
||||
VirtualFile virtualFile = file.getVirtualFile();
|
||||
if (virtualFile != null) {
|
||||
|
||||
@@ -44,7 +44,7 @@ public class JetPsiHeuristicsUtil {
|
||||
if (isTopLevelDeclaration(classOrObject) && classOrObject.hasModifier(JetTokens.PRIVATE_KEYWORD)) {
|
||||
// The class is declared private in the targetPackage
|
||||
// It is visible in this package and all of its subpackages
|
||||
JetFile targetFile = (JetFile) classOrObject.getContainingFile();
|
||||
JetFile targetFile = classOrObject.getContainingJetFile();
|
||||
FqName targetPackage = targetFile.getPackageFqName();
|
||||
FqName fromPackage = fromFile.getPackageFqName();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user