diff --git a/java/java-impl/src/com/intellij/psi/impl/smartPointers/AnchorElementInfo.java b/java/java-impl/src/com/intellij/psi/impl/smartPointers/AnchorElementInfo.java index 4c03154a9f0c..e0f4bbe04e62 100644 --- a/java/java-impl/src/com/intellij/psi/impl/smartPointers/AnchorElementInfo.java +++ b/java/java-impl/src/com/intellij/psi/impl/smartPointers/AnchorElementInfo.java @@ -35,14 +35,14 @@ class AnchorElementInfo extends SelfElementInfo { private IStubElementType myStubElementType; AnchorElementInfo(@NotNull PsiElement anchor, @NotNull PsiFile containingFile) { - super(containingFile.getProject(), anchor.getTextRange(), anchor.getClass(), containingFile, anchor.getLanguage()); + super(containingFile.getProject(), anchor.getTextRange(), anchor.getClass(), containingFile, containingFile.getLanguage()); } // will restore by stub index until file tree get loaded AnchorElementInfo(@NotNull PsiElement anchor, @NotNull PsiFileWithStubSupport containingFile, int stubId, @NotNull IStubElementType stubElementType) { - super(containingFile.getProject(), new TextRange(0,0), anchor.getClass(), containingFile, anchor.getLanguage()); + super(containingFile.getProject(), new TextRange(0,0), anchor.getClass(), containingFile, containingFile.getLanguage()); this.stubId = stubId; myStubElementType = stubElementType; IElementType contentElementType = ((PsiFileImpl)containingFile).getContentElementType(); diff --git a/platform/lang-impl/src/com/intellij/psi/impl/smartPointers/SelfElementInfo.java b/platform/lang-impl/src/com/intellij/psi/impl/smartPointers/SelfElementInfo.java index d05b4ec6162e..77089316d8c6 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/smartPointers/SelfElementInfo.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/smartPointers/SelfElementInfo.java @@ -49,7 +49,7 @@ public class SelfElementInfo implements SmartPointerElementInfo { protected final Language myLanguage; protected SelfElementInfo(@NotNull Project project, @NotNull PsiElement anchor) { - this(project, anchor.getTextRange(), anchor.getClass(), anchor.getContainingFile(), anchor.getLanguage()); + this(project, anchor.getTextRange(), anchor.getClass(), anchor.getContainingFile(), anchor.getContainingFile().getLanguage()); } public SelfElementInfo(@NotNull Project project, @NotNull TextRange anchor, diff --git a/platform/lang-impl/src/com/intellij/psi/impl/smartPointers/SmartPsiElementPointerImpl.java b/platform/lang-impl/src/com/intellij/psi/impl/smartPointers/SmartPsiElementPointerImpl.java index 88d04f8cdbf6..77b7b340495e 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/smartPointers/SmartPsiElementPointerImpl.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/smartPointers/SmartPsiElementPointerImpl.java @@ -179,7 +179,7 @@ class SmartPsiElementPointerImpl implements SmartPointerEx if (isMultiRoot && !isElementInMainRoot) { return new MultiRootSelfElementInfo(project, element.getTextRange(), element.getClass(), containingFile, containingFile.getLanguage()); } - return new SelfElementInfo(project, element.getTextRange(), element.getClass(), containingFile, element.getLanguage()); + return new SelfElementInfo(project, element.getTextRange(), element.getClass(), containingFile, containingFile.getLanguage()); } public void documentAndPsiInSync() {