diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/KtCodeFragment.kt b/compiler/psi/src/org/jetbrains/kotlin/psi/KtCodeFragment.kt index 2f96f354c56..f3bd462061e 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/psi/KtCodeFragment.kt +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/KtCodeFragment.kt @@ -87,7 +87,8 @@ abstract class KtCodeFragment( override fun getContext(): PsiElement? { if (fakeContextForJavaFile != null) return fakeContextForJavaFile if (context !is KtElement) { - LOG.warn("CodeFragment with non-kotlin context should have fakeContextForJavaFile set: \noriginalContext = ${context?.getElementTextWithContext()}") + val logInfoForContextElement = (context as? PsiFile)?.virtualFile?.path ?: context?.getElementTextWithContext() + LOG.warn("CodeFragment with non-kotlin context should have fakeContextForJavaFile set: \noriginalContext = $logInfoForContextElement") return null } diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/KtCodeFragment.kt.181 b/compiler/psi/src/org/jetbrains/kotlin/psi/KtCodeFragment.kt.181 index 8dd2aeeeae3..f76f6504f45 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/psi/KtCodeFragment.kt.181 +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/KtCodeFragment.kt.181 @@ -87,7 +87,8 @@ abstract class KtCodeFragment( override fun getContext(): PsiElement? { if (fakeContextForJavaFile != null) return fakeContextForJavaFile if (context !is KtElement) { - LOG.warn("CodeFragment with non-kotlin context should have fakeContextForJavaFile set: \noriginalContext = ${context?.getElementTextWithContext()}") + val logInfoForContextElement = (context as? PsiFile)?.virtualFile?.path ?: context?.getElementTextWithContext() + LOG.warn("CodeFragment with non-kotlin context should have fakeContextForJavaFile set: \noriginalContext = $logInfoForContextElement") return null }