mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix PY-20876 'Replace with str.format method call' is messed up with sets
This commit is contained in:
+2
-4
@@ -304,10 +304,8 @@ public class ConvertFormatOperatorToMethodIntention extends BaseIntentionAction
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (rhsType instanceof PyCollectionType) {
|
||||
if ("dict".equals(rhsType.getName())) {
|
||||
target.append("(**").append(paramText).append(")");
|
||||
}
|
||||
else if (rhsType instanceof PyCollectionType && "dict".equals(rhsType.getName())) {
|
||||
target.append("(**").append(paramText).append(")");
|
||||
}
|
||||
else target.append("(").append(paramText).append(")"); // tuple is ok as is
|
||||
// Correctly handle multiline implicitly concatenated string literals (PY-9176)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
print('%s' <caret>% {1, 2})
|
||||
@@ -0,0 +1 @@
|
||||
print('{}'.format({1, 2}))
|
||||
+6
-1
@@ -82,5 +82,10 @@ public class PyConvertFormatOperatorToMethodIntentionTest extends PyIntentionTes
|
||||
// PY-20803
|
||||
public void testStarWidthPrecision() {
|
||||
doNegativeTest(PyBundle.message("INTN.replace.with.method"));
|
||||
}
|
||||
}
|
||||
|
||||
// PY-20876
|
||||
public void testSet() {
|
||||
doTest(PyBundle.message("INTN.replace.with.method"), LanguageLevel.PYTHON26);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user