-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
Cursor with defines #2774
Cursor with defines #2774
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my perspective it's definitely going in the right direction 👍
bee8160
to
d69b7bf
Compare
437e223
to
a8986d4
Compare
@@ -4,7 +4,8 @@ module internal Fantomas.Core.CodeFormatterImpl | |||
open FSharp.Compiler.Diagnostics | |||
open FSharp.Compiler.Syntax | |||
open FSharp.Compiler.Text | |||
open Fantomas.Core.SyntaxOak | |||
open SyntaxOak |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
open Statement not needed
open SyntaxOak |
override this.Equals _ = false | ||
override this.GetHashCode() = Int32.MinValue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
override this.Equals _ = false | |
override this.GetHashCode() = Int32.MinValue | |
override _.Equals _ = false | |
override _.GetHashCode() = Int32.MinValue |
Co-authored-by: dawe <[email protected]>
a8986d4
to
f58c7e5
Compare
* Refactor processing of multiple defines into separate module. * Improve correctness of the behavior. * Fix remaining Util tests. * Format MultipleDefineCombinations.fs * Apply suggestions from code review Co-authored-by: dawe <[email protected]> * Remove redundant elif * Implement Equals and GetHashCode. --------- Co-authored-by: dawe <[email protected]>
This is related to #2727 and tries to tackle the scenario where we format the code multiple times and merge each back into a single result.
For example:
Fantomas will format this three times:
[]
[ "A" ]
[ "B" ]
In this PR, I'm trying to merge all the results in one go. In the
main
branch we are reducing the results instead, so I think for large files this will be quite beneficial in terms of performance.@dawedawe and @josh-degraw could you please carefully review this PR? The goal was to make everything a bit more understandable than how it works today. I'm not quite sure I've hit the mark just yet.
There are some TODOs left, please let me know what you would do in those cases. I'm not quite sure about everything just yet.