Comment alignment for empty pattern matching case #4216
Unanswered
stringbean
asked this question in
Q&A
Replies: 1 comment 1 reply
-
there's no way, in fact, the opposite may have been an early feature request. try adding a comment after your processWork line to see what happens. in scalafmt, you can describe what a case statement does via a comment just before it (sort of like a scaladoc which comes before a method), or on the line as the arrow. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We'd like to tweak the alignment for comments in empty pattern match case blocks to match the code in non-empty case blocks. Our codebase has a number of places where we need to satisfy all matching cases but not do anything so we generally put in a comment explaining why (so it's obvious that it's required).
How scalafmt formats it:
How we'd like it to format:
I've looked through the config docs but I haven't been able to find anything that sounds relevant to what we want. Is there a way to do this currently or should I raise a feature request?
Beta Was this translation helpful? Give feedback.
All reactions