mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 09:19:13 +07:00
Support pop on keyword container (PY-26284)
This commit is contained in:
+1
-1
@@ -227,7 +227,7 @@ public class ConvertVariadicParamIntention extends PyBaseIntentionAction {
|
||||
final PyExpression qualifier = callee.getQualifier();
|
||||
return qualifier != null &&
|
||||
qualifier.getText().equals(keywordContainerName) &&
|
||||
ArrayUtil.contains(callee.getReferencedName(), "get", PyNames.GETITEM);
|
||||
ArrayUtil.contains(callee.getReferencedName(), "get", "pop", PyNames.GETITEM);
|
||||
}
|
||||
)
|
||||
.isPresent();
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
def foo(w, <caret>q = 2, **kwargs):
|
||||
a = kwargs.pop('tmp')
|
||||
doSomething(kwargs.pop('foo', 22))
|
||||
doSomething(kwargs.pop('bar', default=23))
|
||||
@@ -0,0 +1,4 @@
|
||||
def foo(w, tmp, q = 2, foo=22, bar=23, **kwargs):
|
||||
a = tmp
|
||||
doSomething(foo)
|
||||
doSomething(bar)
|
||||
@@ -239,6 +239,11 @@ public class PyIntentionTest extends PyTestCase {
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON30, () -> doTest(PyBundle.message("INTN.convert.variadic.param")));
|
||||
}
|
||||
|
||||
// PY-26284
|
||||
public void testConvertVariadicParamKeywordContainerPop() {
|
||||
doTest(PyBundle.message("INTN.convert.variadic.param"));
|
||||
}
|
||||
|
||||
public void testConvertTripleQuotedString() { //PY-2697
|
||||
doTest(PyBundle.message("INTN.triple.quoted.string"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user