-
Notifications
You must be signed in to change notification settings - Fork 186
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
Handle merlin typed holes #1698
Conversation
Wow, that was quick, thanks! It works like a charm for me so far :-) |
e77aa73
to
e76a254
Compare
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.
Sorry if this has already been considered. Merlin already has a parser that supports this feature and is rebased regularly. What about vendoring merlin's parser ? (without taking advantage of the recovery for now)
We will make more changes and diverge further from the upstream ocaml parser ([ ] lists soon, type disambiguations, I also want to try a few things for the comments, same for literal strings, add a location to constants, etc.) anyway |
e76a254
to
8d28cef
Compare
8d28cef
to
1f858a2
Compare
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.
Could it be useful to have a "hole" case in longident too ?
For example:
module_type
(module type T = _
, ormodule M : _
in mli)Pexp_field
(x._
),Pexp_new
(new _
), module pack ((module _)
)
It would also supersede Pmod_hole
and Pexp_hole
and add the hole syntax everywhere it's possible.
This suggestion doesn't make sense for the merlin use case, which only need the current patch. It would be useful for quickly fixing the syntax in order to format and makes the patch easier to rebase (as you said, we are diverging from merlin's parser too).
I tried doing that, the issue is that the underscore is already a valid rule for patterns, types and modules names, so it creates conflicts in the parser, the modification to solve all of this would be more involved |
The fix is to remove the "any" pattern and type too. My claim that it'll make the patch simpler to rebase might be wrong. |
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.
LGTM
no diff with test_branch.sh
cc @ulugbekna @voodoos