[LC] KtLightIdentifierBase: add missing copy
^KT-54051
This commit is contained in:
committed by
Space Team
parent
43561a935c
commit
577bc243d2
+3
@@ -20,12 +20,15 @@ abstract class KtLightIdentifierBase(
|
|||||||
override fun getContainingFile() = lightOwner.containingFile
|
override fun getContainingFile() = lightOwner.containingFile
|
||||||
override fun getTextRange() = origin?.textRange ?: TextRange.EMPTY_RANGE
|
override fun getTextRange() = origin?.textRange ?: TextRange.EMPTY_RANGE
|
||||||
override fun getTextOffset(): Int = origin?.textOffset ?: -1
|
override fun getTextOffset(): Int = origin?.textOffset ?: -1
|
||||||
|
abstract override fun copy(): PsiElement
|
||||||
}
|
}
|
||||||
|
|
||||||
open class KtLightIdentifier(
|
open class KtLightIdentifier(
|
||||||
lightOwner: PsiElement,
|
lightOwner: PsiElement,
|
||||||
private val ktDeclaration: KtDeclaration?
|
private val ktDeclaration: KtDeclaration?
|
||||||
) : KtLightIdentifierBase(lightOwner, ktDeclaration?.name) {
|
) : KtLightIdentifierBase(lightOwner, ktDeclaration?.name) {
|
||||||
|
override fun copy(): PsiElement = KtLightIdentifier(parent, ktDeclaration)
|
||||||
|
|
||||||
override val origin: PsiElement?
|
override val origin: PsiElement?
|
||||||
get() = when (ktDeclaration) {
|
get() = when (ktDeclaration) {
|
||||||
is KtSecondaryConstructor -> ktDeclaration.getConstructorKeyword()
|
is KtSecondaryConstructor -> ktDeclaration.getConstructorKeyword()
|
||||||
|
|||||||
+1
@@ -19,6 +19,7 @@ internal class SymbolLightIdentifier(
|
|||||||
lightOwner: PsiElement,
|
lightOwner: PsiElement,
|
||||||
private val ktSymbol: KtSymbol?
|
private val ktSymbol: KtSymbol?
|
||||||
) : KtLightIdentifierBase(lightOwner, (ktSymbol as? KtNamedSymbol)?.name?.identifierOrNullIfSpecial) {
|
) : KtLightIdentifierBase(lightOwner, (ktSymbol as? KtNamedSymbol)?.name?.identifierOrNullIfSpecial) {
|
||||||
|
override fun copy(): PsiElement = SymbolLightIdentifier(parent, ktSymbol)
|
||||||
|
|
||||||
override val origin: PsiElement?
|
override val origin: PsiElement?
|
||||||
get() = when (val ktDeclaration = ktSymbol?.psi) {
|
get() = when (val ktDeclaration = ktSymbol?.psi) {
|
||||||
|
|||||||
Reference in New Issue
Block a user