[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 getTextRange() = origin?.textRange ?: TextRange.EMPTY_RANGE
|
||||
override fun getTextOffset(): Int = origin?.textOffset ?: -1
|
||||
abstract override fun copy(): PsiElement
|
||||
}
|
||||
|
||||
open class KtLightIdentifier(
|
||||
lightOwner: PsiElement,
|
||||
private val ktDeclaration: KtDeclaration?
|
||||
) : KtLightIdentifierBase(lightOwner, ktDeclaration?.name) {
|
||||
override fun copy(): PsiElement = KtLightIdentifier(parent, ktDeclaration)
|
||||
|
||||
override val origin: PsiElement?
|
||||
get() = when (ktDeclaration) {
|
||||
is KtSecondaryConstructor -> ktDeclaration.getConstructorKeyword()
|
||||
|
||||
+1
@@ -19,6 +19,7 @@ internal class SymbolLightIdentifier(
|
||||
lightOwner: PsiElement,
|
||||
private val ktSymbol: KtSymbol?
|
||||
) : KtLightIdentifierBase(lightOwner, (ktSymbol as? KtNamedSymbol)?.name?.identifierOrNullIfSpecial) {
|
||||
override fun copy(): PsiElement = SymbolLightIdentifier(parent, ktSymbol)
|
||||
|
||||
override val origin: PsiElement?
|
||||
get() = when (val ktDeclaration = ktSymbol?.psi) {
|
||||
|
||||
Reference in New Issue
Block a user