Open nojaf opened 6 months ago
Another nitpick here, but
can be avoided by not using cramped
for https://fsprojects.github.io/fantomas/docs/end-users/Configuration.html#fsharp_multiline_bracket_style.
Would you be on board to switch to aligned
or stroustrup
for either these two files or all the code?
@baronfel @TheAngryByrd?
Either of those modes is acceptable to me
I’ve been wanting to move to either for a while just haven’t bit the bullet. Let’s do it.
@TheAngryByrd which one do you prefer?
stroustrup
Yeah, this is something we want to do after the nightly (8.0.300
) is merged back into main.
Too many changes there. I also found https://github.com/fsprojects/fantomas/issues/3070
Yeah, this is something we want to do after the nightly (
8.0.300
) is merged back into main. Too many changes there. I also found fsprojects/fantomas#3070
Does this mean you want to wait a bit to merge this, or that we should merge this and change the formatting in a separate PR?
I still need to improve this PR a bit regardless of formatting. I would do format configuration changes in a separate PR.
@brianrourkeboll would you mind taking a peek at https://github.com/ionide/FsAutoComplete/pull/1252/commits/90f17fa82e59a6ff42efd1b702bcfbf7fb66a913 I had to change some tests, so I'm probably doing something wrong.
@brianrourkeboll would you mind taking a peek at 90f17fa I had to change some tests, so I'm probably doing something wrong.
The parens in those tests are indeed not needed. https://github.com/dotnet/fsharp/pull/16973 isn't available yet, is it?
The parens in those tests are indeed not needed. https://github.com/dotnet/fsharp/pull/16973 isn't available yet, is it?
No, it is not available in the nightlies. But I wasn't sure if that was the problem or if my code was just incorrect. I did not bother to use accurate ranges in the checks for the new code. I can't tell how relevant that part is.
No, it is not available in the nightlies. But I wasn't sure if that was the problem or if my code was just incorrect.
OK. Once that is available, I believe the API should no longer say parens are required for not (a)
, etc.
I did not bother to use accurate ranges in the checks for the new code. I can't tell how relevant that part is.
I think that the ranges should not matter for the vast majority of hypothetical parenthesization scenarios (assuming https://github.com/dotnet/fsharp/pull/16973 is in place). The times when they do matter are:
if
/then
/else
s on the same line, nested match
-like constructs on the same line, typed expressions on the same line before a match
-clause arrow, etc. This likewise shouldn't be a problem for most code fix scenarios, since again problematic code would already be causing a compiler error.
WIP, I'll need to circle back to this one when I encounter some more real-life situations.