-
-
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
RFC: self/this/xxx consistency? #904
Comments
Source will be formatted using this command: fantomas --config fantomas-config.json --recurse src/GWallet.Backend/ This version of fantomas doesn't crash anymore when formatting it: dotnet tool install -g fantomas-tool --add-source https://www.myget.org/F/fantomas/api/v3/index.json --framework netcoreapp3.1 --version 4.0.0-alpha-008-alpha-190 Last issues left to fix (by order of priority, top is more important): - fsprojects/fantomas#898 (comment) - fsprojects/fantomas#907 - fsprojects/fantomas#905 - fsprojects/fantomas#908 - fsprojects/fantomas#712 - fsprojects/fantomas#904
I would prefer not to have these kind of things in Fantomas. Extreme example: let this = 8
type Foo() =
member bar.DoSomething(a:int):int =
let bar = 4
a + bar + this
Foo().DoSomething(1)
|> printfn "%A" after replacement: let this = 8
type Foo() =
member this.DoSomething(a:int):int =
let this = 4
a + this + this
Foo().DoSomething(1)
|> printfn "%A" The result would be different and we would have broken the code. |
Good point, then this might be a candidate for a subtask for the "Resharper for F#" wishlist: #893 |
Just wanted to ask if this is a worthy goal for fantomas?
First: I'm not sure if MS style guidelines recommend a specific word? Is it
this
to make code more similar to C#?Maybe it's just good enough to keep this under a setting? i.e. in case the guidelines don't say anything about this, let fantomas not change anything but allow adjusting the consistency with a "string"-typed setting named
EnforceNonStaticThisName
or something like that?The text was updated successfully, but these errors were encountered: