[kotlin] String literal within val/var declaration should be re-analyzed

#KTIJ-25528
#KTIJ-20783 Fixed

GitOrigin-RevId: 4dbc9fceb7f45bd9450720f14286dfd90fbef8c2
This commit is contained in:
Vladimir Dolzhenko
2023-06-02 15:28:36 +00:00
committed by intellij-monorepo-bot
parent 51c1839b31
commit 90cda71e63
3 changed files with 3 additions and 3 deletions
@@ -75,7 +75,7 @@ class PureKotlinCodeBlockModificationListener(val project: Project) : Disposable
private inline fun isStringLiteralChange(changeSet: TreeChangeEvent): Boolean = isSpecificChange(changeSet) {
it?.elementType == KtTokens.REGULAR_STRING_PART &&
it?.psi?.parentOfTypes(KtAnnotationEntry::class, KtIfExpression::class, KtWhenCondition::class) == null
it?.psi?.parentOfTypes(KtAnnotationEntry::class, KtValVarKeywordOwner::class) == null
}
/**
@@ -1,4 +1,4 @@
// OUT_OF_CODE_BLOCK: FALSE
// OUT_OF_CODE_BLOCK: TRUE
class Test {
val q = "aasdf<caret>"
}
@@ -4,7 +4,7 @@
fun foo(s: String): Int {
return when (s) {
"hello" -> 0
"<caret>hello" -> 1
"<caret>ello" -> 1
else -> 42
}
}