-
-
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
MaxValueBindingWidth and MaxFunctionBindingWidth settings #866
Conversation
8d6907d
to
596b9c9
Compare
Some of the existing tests were not passing after MaxBindingWidth was implemented for members. The reason is that members did not respect MaxLetBindingWidth before, only PageWidth. Since members now also respect MaxBindingWidth, some results of existing tests are different.
@nojaf The first phase is done. Please have a look. This has been done so far:
When we get this stage to an acceptable level I will continue by splitting |
So I took a look and tried to confirm my initial suspicions: this PR has more code changes than needed. Two things to note:
@Bobface could you revisit this PR based on my findings? |
@nojaf I've updated the changes to use your implementation for the CodePrinter. The changes to the Context have been removed. |
@Bobface could you add a test for when the member binding is typed, please. |
@nojaf Done. |
Hey @Bobface thanks for adding the test. |
MaxValueBindingWidth and MaxFunctionBindingWidth
@nojaf I've split the setting into two. There is currently one failing test:
The reason is that the active pattern is not identified as function by the helper:
Maybe you could give me a hint how I can make that helper match active patterns as functions? |
@Bobface on top my head I think you can get arround it with some regex magic. Named
(Wild tmp.fsx (2,5--2,14) IsSynthetic=false,|Other|_|,false,
None,tmp.fsx (2,5--2,14) IsSynthetic=false), Maybe do a regex to matches Or maybe try and deduce the information from SynBinding -> SynValData -> SynValInfo -> SynArgInfo. See docs for more info. |
@nojaf Nevermind. |
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.
Nice work @Bobface!
@nojaf Thanks! I have removed the unused helper function, it did not have anything to do with this PR. |
@Bobface I will most likely release a new alpha by the end of the week. |
This PR will implement the change from a single
MaxLetBindingWidth
setting to two separate settingsMaxValueBindingWidth
andMaxFunctionBindingWidth
in two steps:MaxLetBindingWidth
setting toMaxBindingWidth
MaxBindingWidth
into two separate settingsMaxValueBindingWidth
andMaxFunctionBindingWidth
The new settings while handle these situations:
MaxValueBindingWidth
: Handles values likelet someValue = 1
MaxFunctionBindingWidth
: Handles function definitions likelet someFunction someParam = someParam + 1