-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Long type argument with constraints is not respecting max_line_length #2266
Comments
@dsyme should we introduce a label to annotate all problems related to formatting |
No need I think - it's not much difference from the fantomas perspective, and at this stage nothing is blocked in dotnet/fsharp |
I'm not too sure about the style guide here, it does feel like it's harder to read with the constraints only indented so far. However I'm not sure what to do about it, c.f. type Event<'Delegate, 'Args
when 'Delegate: delegate<'Args, unit>
and 'Delegate :> System.Delegate
and 'Delegate: not struct>
()
=
class
end |
But Don, that would be a vanity alignment. |
Perhaps multi line type args should go a bit like multi line term args, eg type Event<
'Delegate,
'Args
when
'Delegate: delegate<'Args, unit> and
'Delegate :> System.Delegate and
'Delegate: not struct
> ()
=
class
end |
4-space or 8-space. I guess the latter is vanity and the former is not? |
That isn't valid code I'm afraid, How about this. |
The How about: type ALooooooooooooooooong
<'TLooooooooooooong, 'VLooooooooooong
when 'TLooooooooooooong: delegate<'VLooooooooooong, unit>
and 'TLooooooooooooong :> System.Delegate
and 'TLooooooooooooong: not struct> ()
=
class
end |
This again gives a warning... |
Issue created from fantomas-online
Code
Result
Problem description
Reading https://docs.microsoft.com/en-us/dotnet/fsharp/style-guide/formatting#formatting-explicit-generic-type-arguments-and-constraints and https://docs.microsoft.com/en-us/dotnet/fsharp/style-guide/formatting#formatting-function-and-member-arguments, I think this should be more like:
Extra information
Options
Fantomas master branch at 2022-05-18T11:51:41Z - ce92e66
Default Fantomas configuration
Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?
The text was updated successfully, but these errors were encountered: