[mini.ai] Argument textobject and Python generics on new line #2007
-
Contributing guidelines
Module(s)mini.ai QuestionThe argument textobject is incredibly useful, for deleting and moving arguments. I tend to use it very often. But there's a slight hiccup that sometimes happens. Python puts generics for type hints inside square brackets, and arguments can be on new lines, inside parentheses: def first_function(variable1: int, variable2: list[str]):
pass
def second_function_with_very_long_name(
variable1: int, variable2: list[str]
):
pass If I am anywhere in the first function and I delete an argument with This isn't expected behavior, but I'm not sure what I'd need to modify to fix this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I am afraid this is expected with the default
So in this case the
Here are the ways to mitigate this:
|
Beta Was this translation helpful? Give feedback.
I am afraid this is expected with the default
cover_or_next
search method. Mostly as a combination of the following:argument
textobject works only based on the text without any semantic understanding of the structure.So in this case the
str
inside[]
is recognized as a single argument (because it is inside balanced[]
) while there is no other arguments when taking only a single line into account (there is no other balanced brackets; they are on neighborhood lines). This makes 'mini.ai' do the following search:str
- there…