-
Notifications
You must be signed in to change notification settings - Fork 9
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
Backport PR #1800 #73
Conversation
I can confirm that this PR is a correct backport of the patch from upstream merlin. So that's good. But I think there is a better way to do this: just fix Untypeast. The fix as written is fragile, in that it will do the wrong thing in the presence of ghost locations from ppxes. I would think a better solution would be to record, in typedtree, whether an optional argument was actually passed or not. Maybe by editing That said, it's probably best just to merge this patch for now. I predict, though, that we'll get reports of new odd behavior soon. |
Do you know if there's a reason why the code doesn't also look for whether the argument is |
@goldfirere For what it's worth, Merlin destruct already does the wrong thing in the presence of ppxes. For example, destructing I do agree though that modifying the typedtree would be a nicer solution. An even nicer solution in my opinion would be recovering the original text typed by the user and using it instead, which would circumvent any ppx issues. I think @ncik-roberts solution of checking whether the argument is |
I'm going to hold off merging this until Nick's suggestion has filtered into upstream and then replace my changes in this PR with that. That way, we keep in sync with upstream. |
ocaml/merlin#1807 appears to have been merged into ocaml/merlin. |
Signed-off-by: Liam Stevenson <lstevenson@janestreet.com>
Signed-off-by: Liam Stevenson <lstevenson@janestreet.com>
This reverts commit 3d539a9. Signed-off-by: Liam Stevenson <lstevenson@janestreet.com>
Signed-off-by: Liam Stevenson <lstevenson@janestreet.com>
I've brought in that change now. |
Looks good to merge |
Backport PR #1800 from upstream , which fixes a bug in destructing functions with optional arguments.