-
Notifications
You must be signed in to change notification settings - Fork 9
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
Moving last argument when there others with omitted type in Go #21
Comments
Unfortunately, I can't think of any way to implement this properly in the plugin. The way it works is with simple patterns for the start/end pair of brackets, and for the delimiter: sideways.vim/plugin/sideways.vim Lines 11 to 16 in 2d5cd2b
The only working idea I can think of is to transform the |
Yeah, me neither. Especially when decided to dig more into generalizing the issue. It's more complicated than what I first thought. Can think of at least two more problematic cases:
Yeah, that will fix it but On the other hand, based on my experience and looking around in the standard library compacting argument's types when possible seems like widely accepted implicit convention. So it might not be the worst idea ever. In any case, I would love if you get the transform -> move -> compact approach working, but at the same time completely understand if you decide to close this and decide to not fix it at all. |
Suppose we have the function
foo
defined as follows:Given that both arguments are of the same type we could omit the type declaration of
a
:In that case when moving any of the arguments,
a
becomes the last argument without declared type, which is invalid Go code:The text was updated successfully, but these errors were encountered: