-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does it make sense to treat elements in a tuple/array literal as part of the @parameter object? #86
Comments
@IndianBoy42 do you have a file we can use to test what you mean? |
This can be a problem for dynamically typed programming languages such as Python and Lua where dicts/arrays/... can be passed directly as arguments. function_call(1, [8, 38, 2, 5]) function_call({
value1 = true,
some_number = 35,
child_table = {
something = "something"
}
}, true) I find it very convincing to be able to select such objects. This way, I can quickly swap arguments, move some to their own local variables, etc. But I also frequently find it lacking that there's no selector for dict entries / table members out of the box. Maybe there should be a query that does exactly what you propose, but named different. To be able to select all the delimited objects, including function arguments. |
This was already done in #87. But I agree that it makes sense to have those as a separate capture. |
I think arguments could be made either way. Either you just want a 'smarter' select inside comma separated list, or you really want to be specific about the semantic element One of the troubles is the sheer number of different text objects you could define semantically |
I would also love to have a text object for comma separated items inside an array/list/table/dictionary. To me it makes sense to have a different capture group than |
I would go with |
They are syntactically similar, and semantically not that different. I think there should be a text object for entries in lists/tuples/dictionaries, but the question is whether it should be in the parameter text object or another (@entry? @element)
The text was updated successfully, but these errors were encountered: