-
-
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
KeepIndentInBranch not respected when returning short function application #1779
Comments
I agree, this should probably unindent. What's the problem that means the AST doesn't determine what to do here? |
Oh I mean when you have something like this: Error [ sprintf "Provided modelSrc \"%s\" does not exist" modelSrc ] the matching AST looks like App
(NonAtomic, false, Ident Error,
ArrayOrListOfSeqExpr
(false,
CompExpr
(true, { contents = true },
App
(NonAtomic, false,
App
(NonAtomic, false, Ident sprintf,
Const
(String
("Provided modelSrc "%s" does not exist",
tmp.fsx (2,20--2,61) IsSynthetic=false),
tmp.fsx (2,20--2,61) IsSynthetic=false),
tmp.fsx (2,12--2,61) IsSynthetic=false),
Ident modelSrc, tmp.fsx (2,12--2,70) IsSynthetic=false),
tmp.fsx (2,12--2,70) IsSynthetic=false),
tmp.fsx (2,10--2,72) IsSynthetic=false),
tmp.fsx (2,4--2,72) IsSynthetic=false) so a nested Error
[
sprintf "Provided modelSrc \"%s\" does not exist" modelSrc
// some comment, same AST though
] I'm guessing you would indent if the application was multiline. |
I'm going to solve this purely based on AST. |
Issue created from fantomas-online
Code
Result
Problem description
This is a good example where AST alone is probably not sufficient enough to make the right call whether this should keep the indent.
@Smaug123 I'm correct that is should not indent the else branch right?
Extra information
Options
Fantomas Master at 06/12/2021 10:31:17 - 8f71594
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: