-
Notifications
You must be signed in to change notification settings - Fork 234
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
Rename does not work properly with ppx_string #1671
Comments
Yes, the AST output has a For Merlin to work as expected, the locations in the generated AST should match with the original locations in the source. I think two actions can be taken here:
|
The |
CHANGES: Thu Sep 24 18:01:42 CEST 2023 + merlin binary - Improve error messages for missing configuration reader (ocaml/merlin#1669) - Fix regression causing crash when using ppxes under Windows (ocaml/merlin#1673) - Fix confusion between aliased modules and module types (ocaml/merlin#1676, fixes ocaml/merlin#1667) - Ignore hidden branches when listing occurrences (ocaml/merlin#1677, fixes ocaml/merlin#1671) + editor modes - emacs: fix/improve keybindings (ocaml/merlin#1668, fixes ocaml/merlin#1386): Unbind <kbd>C-c C-r</kbd> (to avoid shadowing `tuareg-eval-region`) and bind <kbd>C-c C-v</kbd> instead to `merlin-error-check`; rebind <kbd>C-c C-d</kbd> to `merlin-document` and bind <kbd>C-c M-d</kbd> and <kbd>C-c |</kbd> instead to `merlin-destruct`; bind <kbd>C-u C-c C-t</kbd> to `merlin-type-expr`. See also <ocaml/merlin#1386 (comment)> - emacs: remove use of obsolete `defadvice` macro (ocaml/merlin#1675)
CHANGES: Thu Sep 24 18:01:42 CEST 2023 + merlin binary - Improve error messages for missing configuration reader (ocaml/merlin#1669) - Fix regression causing crash when using ppxes under Windows (ocaml/merlin#1673) - Fix confusion between aliased modules and module types (ocaml/merlin#1676, fixes ocaml/merlin#1667) - Ignore hidden branches when listing occurrences (ocaml/merlin#1677, fixes ocaml/merlin#1671) + editor modes - emacs: fix/improve keybindings (ocaml/merlin#1668, fixes ocaml/merlin#1386): Unbind <kbd>C-c C-r</kbd> (to avoid shadowing `tuareg-eval-region`) and bind <kbd>C-c C-v</kbd> instead to `merlin-error-check`; rebind <kbd>C-c C-d</kbd> to `merlin-document` and bind <kbd>C-c M-d</kbd> and <kbd>C-c |</kbd> instead to `merlin-destruct`; bind <kbd>C-u C-c C-t</kbd> to `merlin-type-expr`. See also <ocaml/merlin#1386 (comment)> - emacs: remove use of obsolete `defadvice` macro (ocaml/merlin#1675)
CHANGES: Thu Sep 24 18:01:42 CEST 2023 + merlin binary - Add support for OCaml 5.1 - Improve error messages for missing configuration reader (ocaml/merlin#1669) - Fix regression causing crash when using ppxes under Windows (ocaml/merlin#1673) - Fix confusion between aliased modules and module types (ocaml/merlin#1676, fixes ocaml/merlin#1667) - Ignore hidden branches when listing occurrences (ocaml/merlin#1677, fixes ocaml/merlin#1671) + editor modes - emacs: fix/improve keybindings (ocaml/merlin#1668, fixes ocaml/merlin#1386): Unbind <kbd>C-c C-r</kbd> (to avoid shadowing `tuareg-eval-region`) and bind <kbd>C-c C-v</kbd> instead to `merlin-error-check`; rebind <kbd>C-c C-d</kbd> to `merlin-document` and bind <kbd>C-c M-d</kbd> and <kbd>C-c |</kbd> instead to `merlin-destruct`; bind <kbd>C-u C-c C-t</kbd> to `merlin-type-expr`. See also <ocaml/merlin#1386 (comment)> - emacs: remove use of obsolete `defadvice` macro (ocaml/merlin#1675)
CHANGES: Thu Sep 24 18:01:42 CEST 2023 + merlin binary - Improve error messages for missing configuration reader (ocaml/merlin#1669) - Fix regression causing crash when using ppxes under Windows (ocaml/merlin#1673) - Fix confusion between aliased modules and module types (ocaml/merlin#1676, fixes ocaml/merlin#1667) - Ignore hidden branches when listing occurrences (ocaml/merlin#1677, fixes ocaml/merlin#1671) + editor modes - emacs: fix/improve keybindings (ocaml/merlin#1668, fixes ocaml/merlin#1386): Unbind <kbd>C-c C-r</kbd> (to avoid shadowing `tuareg-eval-region`) and bind <kbd>C-c C-v</kbd> instead to `merlin-error-check`; rebind <kbd>C-c C-d</kbd> to `merlin-document` and bind <kbd>C-c M-d</kbd> and <kbd>C-c |</kbd> instead to `merlin-destruct`; bind <kbd>C-u C-c C-t</kbd> to `merlin-type-expr`. See also <ocaml/merlin#1386 (comment)> - emacs: remove use of obsolete `defadvice` macro (ocaml/merlin#1675)
CHANGES: Thu Sep 24 18:01:42 CEST 2023 + merlin binary - Improve error messages for missing configuration reader (ocaml/merlin#1669) - Fix regression causing crash when using ppxes under Windows (ocaml/merlin#1673) - Fix confusion between aliased modules and module types (ocaml/merlin#1676, fixes ocaml/merlin#1667) - Ignore hidden branches when listing occurrences (ocaml/merlin#1677, fixes ocaml/merlin#1671) + editor modes - emacs: fix/improve keybindings (ocaml/merlin#1668, fixes ocaml/merlin#1386): Unbind <kbd>C-c C-r</kbd> (to avoid shadowing `tuareg-eval-region`) and bind <kbd>C-c C-v</kbd> instead to `merlin-error-check`; rebind <kbd>C-c C-d</kbd> to `merlin-document` and bind <kbd>C-c M-d</kbd> and <kbd>C-c |</kbd> instead to `merlin-destruct`; bind <kbd>C-u C-c C-t</kbd> to `merlin-type-expr`. See also <ocaml/merlin#1386 (comment)> - emacs: remove use of obsolete `defadvice` macro (ocaml/merlin#1675)
This bug was originally reported on ocaml/ocaml-lsp#1176, but it seems to be a problem with the response payload Merlin returns for ppx_string. Given a file with 1-indexed lines 242-246,
Here is the query & response with Merlin when the cursor is placed on the
x
argument and Merlin is asked to rename it toy
:Applying these edits produces:
(The
:MerlinRename
command in Vim does not actually apply this transformation faithfully, but ocaml-lsp does).According to this comment, Merlin sometimes gives poor rename responses when there are location issues with the ppx. I see that ppx_string has
https://github.com/janestreet/ppx_string/blob/f2bf7353f9b1f4c92e180685018e88f25d3c3ec4/src/ppx_string.ml#L276-L277
Is this hiding the location information that Merlin needs?
The text was updated successfully, but these errors were encountered: