mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 06:50:54 +07:00
[uast] IDEA-330019 UAST: withUastParentOrSelf patterns are visible in highlighting
GitOrigin-RevId: 24370a4be115862737d79f15ae87cc30a79aacf9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6c893c44ed
commit
a56c52151d
@@ -91,13 +91,10 @@ open class UElementPattern<T : UElement, Self : UElementPattern<T, Self>>(clazz:
|
||||
parentPattern.accepts(it, context) || it.uastParent?.let { parentPattern.accepts(it, context) } ?: false
|
||||
}
|
||||
|
||||
fun withStringRoomExpressionOrSelf(parentPattern: ElementPattern<out UElement>): Self = filterWithContext { it, context ->
|
||||
if (it !is UInjectionHost) return@filterWithContext false
|
||||
|
||||
if (parentPattern.accepts(it, context)) return@filterWithContext true
|
||||
|
||||
val room = it.getStringRoomExpression()
|
||||
if (room === it) return@filterWithContext false
|
||||
fun withStringRoomExpression(parentPattern: ElementPattern<out UElement>): Self = filterWithContext { it, context ->
|
||||
if (it !is UExpression) return@filterWithContext false
|
||||
val uHost = wrapULiteral(it) as? UInjectionHost ?: return@filterWithContext false
|
||||
val room = uHost.getStringRoomExpression()
|
||||
|
||||
parentPattern.accepts(room, context)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user