mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Introduce pattern variable: ignore var setting
GitOrigin-RevId: a34a3b3398cb42c0cb89c4b3254198dea7355f0e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
998ca6cb4c
commit
012d7e163f
+5
-5
@@ -111,11 +111,11 @@ class VariableExtractor {
|
||||
|
||||
if (!(var instanceof PsiPatternVariable)) {
|
||||
PsiUtil.setModifierProperty(var, PsiModifier.FINAL, mySettings.isDeclareFinal());
|
||||
}
|
||||
if (mySettings.isDeclareVarType()) {
|
||||
PsiTypeElement typeElement = var.getTypeElement();
|
||||
LOG.assertTrue(typeElement != null);
|
||||
IntroduceVariableBase.expandDiamondsAndReplaceExplicitTypeWithVar(typeElement, var);
|
||||
if (mySettings.isDeclareVarType()) {
|
||||
PsiTypeElement typeElement = var.getTypeElement();
|
||||
LOG.assertTrue(typeElement != null);
|
||||
IntroduceVariableBase.expandDiamondsAndReplaceExplicitTypeWithVar(typeElement, var);
|
||||
}
|
||||
}
|
||||
myFieldConflictsResolver.fix();
|
||||
return SmartPointerManager.getInstance(myProject).createSmartPsiElementPointer(var);
|
||||
|
||||
@@ -134,7 +134,9 @@ public class IntroduceVariableTest extends LightJavaCodeInsightTestCase {
|
||||
public void testPatternVariableNotUsedAfterwards() {
|
||||
doTest("temp", true, false, false, "boolean");
|
||||
}
|
||||
public void testPatternVariableDeclarationJava14Preview() { doTest("temp", true, false, false, JAVA_LANG_STRING);}
|
||||
public void testPatternVariableDeclarationJava14Preview() {
|
||||
doTestWithVarType(new MockIntroduceVariableHandler("temp", true, false, false, JAVA_LANG_STRING));
|
||||
}
|
||||
public void testPatternVariableDeclarationUsedInLocalJava14Preview() { doTest("temp", true, false, false, JAVA_LANG_STRING);}
|
||||
public void testPatternVariableDeclarationAfterIfJava14Preview() { doTest("temp", true, false, false, JAVA_LANG_STRING);}
|
||||
public void testNonPatternDeclarationJava14Preview() { doTest("temp", true, false, false, JAVA_LANG_STRING);}
|
||||
|
||||
Reference in New Issue
Block a user