ocaml / merlin

Context sensitive completion for OCaml in Vim and Emacs
https://ocaml.github.io/merlin/
MIT License
1.57k stars 232 forks source link

Does rename work with syntax like `[%sedlex.regexp? '0' .. '9']` #1501

Open liweijian opened 2 years ago

liweijian commented 2 years ago

The case was from sedlex, which looks like:

image
voodoos commented 2 years ago

They have been multiple reports regarding weirdness happening when using ppxes. Merlin doesn't do a lot more than calling the ppx on the parse-tree before performing analysis over the result. If the ppx returns incorrect locations in the parse-tree then Merlin cannot work properly and there is not a lot of room for us to improve.

On the other, in this example, hand it looks like the editor should be able to perform some trivial renaming here, except if the file is read-only. It might be worth it to report that issue to the vscode-ocaml-platform people since it feels like the editor should fallback to the built-in renaming system if Merlin cannot provide the occurrences.