merlin
merlin copied to clipboard
Binding operators don't work in occurrences and locate
Binding operators (let*
, and+
etc) don't work in merlin-occurrences
or merlin-locate
, for various reasons:
- Uses of the operators as such (ie, not the function syntax as in
(let*)
) aren't found at all - Reconstructing the identifier from a location doesn't work (the lexer used doesn't seem to know about the syntax)
I have an addendum to PR #1385 that parses these operators for Emacs Xref but it doesn't work without help from the merlin machinery.
Issue #949 seems to be related.
PR #1405 almost fixes this. It's still not possible to run Occurrence from the use of a non-bracketed binding operator, and I'm not sure how to fix that – guidance from someone who knows the code would be useful.
(from a conversation with @voodoos)
As an extra piece of info (that might be another issue), typeof has trouble with expressions that use and+
(though a single let+
seems fine).
Consider this piece of code:
let+ a = ea
and+ b = eb in
()
When I'm on a
or b
and asking for the type, the whole let+....
expression gets highlighted and I get the type for the full one (unit t
).
I suspect this is because Refis laws are a bit weird with these operators, so the query does not detect I'm asking about the binders in a (ghost?) Pexp_fun
expression.
As an extra piece of info (that might be another issue), typeof has trouble with expressions that use
and+
(though a singlelet+
seems fine).
Fixed in #1653
Occurrences and locate should be fixed when we'll roll out the project-wide occurrences.