You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So it seems that formatting comments such as /* inline test */ is a little finnicky within swayfmt. The comments seem to get shifted around in various ways depending on the category that they are identified as. This issue persists across all the items I have tested so far.
It is possible that the whitespace formatting I see is desired, though I wouldn't expect it to be as the items treat the same comments differently.
Just did some testing and those whitespace changes don't exist with cargo fmt. At least not when formatting enum and impl blocks. To save you the trouble, the before and after blocks below are exactly the same.
This was discovered during the progress of #5297.
So it seems that formatting comments such as
/* inline test */
is a little finnicky within swayfmt. The comments seem to get shifted around in various ways depending on the category that they are identified as. This issue persists across all the items I have tested so far.It is possible that the whitespace formatting I see is desired, though I wouldn't expect it to be as the items treat the same comments differently.
Useful commit to pull for testing here.
Example:
Behavior for
item_abi
anditem_impl
:Before:
After:
Behavior for
item_enum
anditem_configurable
:Before:
After:
The implementation for
item_enum
anditem_configurable
are the same. I'm assuming this is why they have the same behavior.Also, if I try to place the same comments inside of
fn test_function()
then the test fails with:This is possibly a duplicate as we fix formatting issues regarding comments, but I couldn't find anything about this in particular.
The text was updated successfully, but these errors were encountered: