-
-
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
Overly aggressive de-indentation #2110
Comments
Hello Steve, thank you for reporting this issue. Potentially add an additional case in fantomas/src/Fantomas/CodePrinter.fs Lines 1671 to 1674 in ef132c1
I'm not quite sure about this, but that would be my starting point. Are you interested in submitting a PR for this? |
I'd have to learn my way around the codebase -- I've not peered under the hood here before. |
In case you are interested, I've made some videos that explain a bit how the code in Fantomas works: https://www.youtube.com/playlist?list=PLvw_J2kfZCX3Mf6tEbIPZXbzJOD1VGl4K |
I believe this problem was solved via #2513. |
The file from which this example was extracted now simply yields
with no further hint as to what was detected; so I cannot currently state whether this issue has been resolved. |
If you pass |
Having used So far, alas, I have not been able to create a cut-down example through the web tool. The configuration I'm using is thus -- the only customisations I recall making since it was generated are the first two lines,
but I notice several differences in width parameters compared with the tool defaults. Tweaking the tool settings to match the Related indentation issue (just warnings here) this sample Code DotNet.test
(fun p ->
(({ p.WithCommon(withWorkingDirectoryVM "_Issue23") with
Configuration = DotNet.BuildConfiguration.Debug
NoBuild = false })
.WithAltCoverOptions
pp0
cc0
ForceTrue)
.WithAltCoverImportModule()
.WithAltCoverGetVersion()
|> testWithCLIArguments)
""
ResultDotNet.test
(fun p ->
(({ p.WithCommon(withWorkingDirectoryVM "_Issue23") with
Configuration = DotNet.BuildConfiguration.Debug
NoBuild = false })
.WithAltCoverOptions
pp0
cc0
ForceTrue)
.WithAltCoverImportModule()
.WithAltCoverGetVersion()
|> testWithCLIArguments)
""
Fantomas master branch at 2022-09-20T21:08:34Z - 11c2a86 { config with
IndentSize = 2
MaxLineLength = 90
MaxIfThenElseShortWidth = 40
MaxInfixOperatorExpression = 50
MaxArrayOrListWidth = 40
MaxValueBindingWidth = 40
MaxDotGetExpressionWidth = 50
NewlineBetweenTypeDefinitionAndMembers = false } |
Note: fantomas 5.0.2 has resolved the original issue -- presumably why I was unable to produce a repro using the online tool. The related issue in the comment above still remains, however. |
That is good enough for me, please create new issues for new cases. |
New issue #2529 created. |
Thanks, I prefer to close issues when a regression test was added. |
Issue created from fantomas-online
Code
Result
Problem description
Overly aggressive de-indentation leading to many offside errors
Extra information
Options
Fantomas master branch at 1/1/1990
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: