mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
i18n fix assignment: detect concatenations in rOperand
GitOrigin-RevId: 62ff07771c6b55807cddee1c0e514540c0b258d7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
15774c3e10
commit
a232f81e1a
+6
@@ -0,0 +1,6 @@
|
||||
class a {
|
||||
void foo(String s) {
|
||||
String desc;
|
||||
desc = i18nizedExpr;
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class a {
|
||||
void foo(String s) {
|
||||
String desc;
|
||||
desc = "Our " + s + " h<caret>as";
|
||||
}
|
||||
}
|
||||
@@ -94,6 +94,7 @@ public class I18nizeTest extends LightJavaCodeInsightTestCase {
|
||||
public void testLongConcat() {doTest();}
|
||||
public void testCharacterLiteral() {doTest();}
|
||||
public void testNestedConcatenation() {doTest();}
|
||||
public void testAssignment() {doTest();}
|
||||
|
||||
public void testShortenClassReferences() {
|
||||
doTest("p.MyBundle.message(\"key\")");
|
||||
|
||||
+2
-1
@@ -17,6 +17,7 @@ import org.jetbrains.uast.*;
|
||||
import org.jetbrains.uast.expressions.UInjectionHost;
|
||||
import org.jetbrains.uast.expressions.UStringConcatenationsFacade;
|
||||
import org.jetbrains.uast.generate.UastCodeGenerationPlugin;
|
||||
import org.jetbrains.uast.util.UastExpressionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -108,7 +109,7 @@ public class I18nizeConcatenationQuickFix extends I18nizeQuickFix {
|
||||
UElement parent = topExpression.getUastParent();
|
||||
if (parent instanceof UParenthesizedExpression ||
|
||||
parent instanceof UIfExpression ||
|
||||
parent instanceof UPolyadicExpression) {
|
||||
parent instanceof UPolyadicExpression && !UastExpressionUtils.isAssignment(parent)) {
|
||||
topExpression = (UExpression)parent;
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user