-
Notifications
You must be signed in to change notification settings - Fork 4k
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
IDE0055 triggered on no space after spread operator #71219
Comments
As with most of formatting, there is no option to control things. The formatting for spreads simply is this way. If not desired, it can be suppressed in these locations, or the analyzer can be entirely disabled. Requests to support arbitrary formatting rules falls under a general formatting extensibility system which we are considering, but have no timeline on. |
@CyrusNajmabadi Is there a Github issue for said new formatting system? |
I agree that the space after |
Space there was chosen by ldm, and corresponds to the same space we chose for the corresponding slice pattern form. This is not an operator, and does not 'bind tightly' (which is when we think there should be no space. As an example: But that's not the case with the spread element. Put another way, it's not a unary expression, so it gets a space |
Can you show sample code defining
The post implicitly claims that users may be confused about the binding precedence, but I'm having a hard time coming up with a case where that could happen. It feels like we penalized all actual cases to account for a case that is either rare or doesn't exist, or maybe I'm just not seeing it yet. |
The point isn't that both compile, it's that the formatting implies one over the other. |
There's no penalty. We made an informed choice to align with slice patterns so that construction and deconstruction would pair up and format uniformly. And we used our general view here on precedence to dictate for both how we felt the formatting should be. |
I get the following warning because there's no space after my spread operator:
I don't even see what formatting option would apply to this, and in any case I don't want a space after my spread operators. It shouldn't give this warning.
The text was updated successfully, but these errors were encountered: