-
-
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
Aesthetics of long members in a type declaration #1362
Comments
Relatedly, by the way, it would be nice to be clear what happens in the following case: type IFoo =
abstract Bar :
[<Path "bar">] bar : string
* [<Path "baz">] baz : string
-> Task<Foo> This arises from using RestEase, for example. I don't have a strong preference for how this is formatted, except that currently Fantomas indents a very long way. It puts the type IFoo =
abstract Bar : [<Path "bar">] bar : string
* [<Path "baz"] baz : string
-> Task<Foo> |
Hello Patrick, this seems doable I think. type IFoo =
abstract Blah :
foo : string ->
bar : string ->
baz : string ->
int
type IFoo =
abstract Bar :
[<Path "bar">] bar : string
* [<Path "baz">] baz : string ->
Task<Foo> I've also raised this in the MS style guide: dotnet/docs#22368 |
That seems reasonable; I think we don't have strong preferences about where the arrows go, as long as they're not all forced to be indented a very long way. Could you let us know what the easiest answer is from Fantomas's point of view, because I don't want to write down some hard requirement which we don't actually care very much about? I'll raise a corresponding GResearch/fsharp-formatting-conventions PR. |
Yep, I'll let you know. |
Issue created from fantomas-online
Code
Result
Problem description
I set the line length very short so as to trigger this.
This is purely stylistic, but I would prefer to follow a different rule: if a member declaration has to be split over multiple lines, then all the arguments should be split onto their own line.
I recognise that this change should be accompanied by a change to the G-Research style guidelines, which are currently silent on the matter. If you think this is a reasonable choice, I'll raise an appropriate PR to https://github.com/G-Research/fsharp-formatting-conventions/ .
Extra information
Options
Fantomas Master at 01/09/2021 08:58:25 - ca42f0d
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: