[FE] Fix source element duplication in object literal expressions

This commit is contained in:
Yan Zhulanow
2022-09-27 02:24:54 +09:00
committed by teamcity
parent ea3f550b58
commit 61ce9fe524
14 changed files with 63 additions and 64 deletions
@@ -35,8 +35,10 @@ object LightTreePositioningStrategies {
): List<TextRange> {
when (node.tokenType) {
KtNodeTypes.OBJECT_LITERAL -> {
val objectKeyword = tree.findDescendantByType(node, KtTokens.OBJECT_KEYWORD)!!
return markElement(objectKeyword, startOffset, endOffset, tree, node)
val objectDeclaration = tree.findDescendantByType(node, KtNodeTypes.OBJECT_DECLARATION)!!
val objectKeyword = tree.objectKeyword(objectDeclaration)!!
val supertypeList = tree.supertypesList(objectDeclaration)
return markRange(objectKeyword, supertypeList ?: objectKeyword, startOffset, endOffset, tree, node)
}
KtNodeTypes.OBJECT_DECLARATION -> {
val objectKeyword = tree.objectKeyword(node)!!