-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
Proof of concept for short expression check. #721
Proof of concept for short expression check. #721
Conversation
Related to issue #697 |
@jindraivanek the build fails because I didn't take any other unit tests into account, please only look at the four new ones to see the impact of the code change. |
I like it, especially the idea of applying It looks like so similar to what |
… into feature/short-record-expression
…from the beginning of the line.
3260b63 and f00e496 remove the This was heavily used to determine if module declarations, let bindings inside let bindings, member bindings and member definitions are multiline. For example: let someBinding =
let a = 42 // short
let b =
someFunctionCall a 8
|> anotherFunctionCallMakingAllOfThisMultiline
|> foo
let c = "short" In If One thing to notice is that trivia can sometimes make a construct multiline. |
This PR is ready for review. |
🎉 |
@jindraivanek this is a suggestion to approach formatting short expressions.
The main idea is that we try an expression similar to a dummy context but shortcut as soon as possible if we detect that the expression if too long or it is multiline.
We can use the shortExpression writerEvents if it is indeed short, else we execute the fallback expression.
Please let me know what you think about this, and if you see any (major) performance concerns.
This PR is a draft, I would finish it once you validated the main concept.
Looping in @Smaug123 as well.
Update:
[ ] Revisit if/then/else[ ] RemoveIsDummy
multliline
New settings: