mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
enter in subscription expression (PY-1992)
This commit is contained in:
@@ -31,7 +31,8 @@ public class PythonEnterHandler implements EnterHandlerDelegate {
|
||||
PyArgumentList.class,
|
||||
PyParameterList.class,
|
||||
PyFunction.class,
|
||||
PySliceExpression.class
|
||||
PySliceExpression.class,
|
||||
PySubscriptionExpression.class
|
||||
};
|
||||
|
||||
@Override
|
||||
|
||||
@@ -46,7 +46,8 @@ public class PyBlock implements ASTBlock {
|
||||
PyElementTypes.PARAMETER_LIST,
|
||||
PyElementTypes.TUPLE_EXPRESSION,
|
||||
PyElementTypes.PARENTHESIZED_EXPRESSION,
|
||||
PyElementTypes.SLICE_EXPRESSION);
|
||||
PyElementTypes.SLICE_EXPRESSION,
|
||||
PyElementTypes.SUBSCRIPTION_EXPRESSION);
|
||||
|
||||
private static final TokenSet ourBrackets = TokenSet.create(PyTokenTypes.LPAR, PyTokenTypes.RPAR,
|
||||
PyTokenTypes.LBRACE, PyTokenTypes.RBRACE,
|
||||
|
||||
@@ -146,6 +146,10 @@ public class PyEditingTest extends PyLightFixtureTestCase {
|
||||
doTestEnter("a = some_list[<caret>slice_start:slice_end]", "a = some_list[\n slice_start:slice_end]");
|
||||
}
|
||||
|
||||
public void testEnterInSubscriptionExpression() { // PY-1992
|
||||
doTestEnter("a = some_list[<caret>slice_start]", "a = some_list[\n slice_start]");
|
||||
}
|
||||
|
||||
private void doTestEnter(String before, final String after) {
|
||||
int pos = before.indexOf("<caret>");
|
||||
before = before.replace("<caret>", "");
|
||||
|
||||
Reference in New Issue
Block a user