[FIR] Optimize performance and fix UNDERSCORE_IS_RESERVED, simplify code
This commit is contained in:
@@ -844,20 +844,10 @@ object PositioningStrategies {
|
||||
if (nameIdentifier != null) {
|
||||
return super.mark(nameIdentifier)
|
||||
}
|
||||
} else if (element is KtImportDirective) {
|
||||
return super.mark(element.alias?.nameIdentifier ?: element)
|
||||
} else if (element is KtReturnExpression) {
|
||||
val prevSibling = element.getPrevSiblingIgnoringWhitespace()
|
||||
if (prevSibling is KtContainerNode) {
|
||||
return mark(prevSibling)
|
||||
}
|
||||
} else if (element !is LeafPsiElement) {
|
||||
val ranges = element.collectDescendantsOfType<LeafPsiElement> { descendant -> descendant.text.all { it == '_' } }
|
||||
.map { markSingleElement(it) }
|
||||
if (ranges.isNotEmpty()) {
|
||||
return ranges
|
||||
}
|
||||
} else if (element is KtLabelReferenceExpression) {
|
||||
return super.mark(element.getReferencedNameElement())
|
||||
}
|
||||
|
||||
return super.mark(element)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user