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
Is your feature request related to a problem? Please describe.
Currently, when pasting code it's possible that the newly pasted code would not align well with the indented blocks. It would be best if we were able to adjust the pasted block indentation to work correctly with the enclosing block. Most likely we would need to use range formatting here.
Describe the solution you'd like
One of the solutions proposed by @odersky:
Tooling concerns: I also have observed that tools could do auto-indentation better. I believe what I would want is this:
When inserting a block of code immediately after some non-empty line, follow the indentation on that line, or indent if it is a token like = or => that opens an indentation region.
When inserting a block of code after some empty line, keep the indentation width of the original block.
Is your feature request related to a problem? Please describe.
Currently, when pasting code it's possible that the newly pasted code would not align well with the indented blocks. It would be best if we were able to adjust the pasted block indentation to work correctly with the enclosing block. Most likely we would need to use range formatting here.
Describe the solution you'd like
One of the solutions proposed by @odersky:
There were some more alternative solutions in https://contributors.scala-lang.org/t/feedback-sought-optional-braces/4702/60
Describe alternatives you've considered
Manually format the code.
Additional context
With Scala 3's optional braces this issue becomes a much bigger problem, as wrong indentation might break the code.
Search terms:
optional braces significant indentation Scala3
The text was updated successfully, but these errors were encountered: