Revert "Light annotations made strictly non-physical (KT-22565)"

This reverts commit cf6e21d
This commit is contained in:
Nicolay Mitropolsky
2018-02-16 13:55:40 +03:00
parent cc7bd80099
commit 47f3a0ce0a
2 changed files with 5 additions and 4 deletions
@@ -95,12 +95,11 @@ class KtLightAnnotationForSourceEntry(
override fun getReferences() = originalExpression?.references.orEmpty()
override fun getLanguage() = KotlinLanguage.INSTANCE
override fun getNavigationElement() = originalExpression
override fun isPhysical(): Boolean = false
override fun isPhysical(): Boolean = originalExpression?.containingFile == kotlinOrigin.containingFile
override fun getTextRange() = originalExpression?.textRange ?: TextRange.EMPTY_RANGE
override fun getParent() = parent
override fun getText() = originalExpression?.text.orEmpty()
override fun getContainingFile(): PsiFile? = if (originalExpression?.containingFile == kotlinOrigin.containingFile)
kotlinOrigin.containingFile else delegate.containingFile
override fun getContainingFile(): PsiFile? = if (isPhysical) kotlinOrigin.containingFile else delegate.containingFile
override fun replace(newElement: PsiElement): PsiElement {
val value = (newElement as? PsiLiteral)?.value as? String ?: return this
@@ -250,6 +249,8 @@ class KtLightAnnotationForSourceEntry(
else -> LightElementValue(value, parent, ktOrigin)
}
override fun isPhysical() = true
override fun getName() = null
private fun wrapAnnotationValue(value: PsiAnnotationMemberValue): PsiAnnotationMemberValue = wrapAnnotationValue(value, this, {