Skip to content
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

Renaming from xref buffer doesn't work #2997

Closed
2 of 3 tasks
tekhnus opened this issue Jul 14, 2021 · 1 comment · Fixed by #4453
Closed
2 of 3 tasks

Renaming from xref buffer doesn't work #2997

tekhnus opened this issue Jul 14, 2021 · 1 comment · Fixed by #4453
Labels

Comments

@tekhnus
Copy link

tekhnus commented Jul 14, 2021

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command
emacs -q -l lsp-start-plain.el

where lsp-start-plain.el can be downloaded here.

Bug description

*xref* buffers support xref-query-replace-in-results command, which renames the symbol in the list matches as requested.

This command seems to be broken in the *xref* buffers created specifically by lsp-find-references, at least with lsp-clangd, at least for me:)

When I use xref-find-references with the default (etags) backend instead of the backend provided by lsp-mode, xref-query-replace-in-results works well.

Steps to reproduce

  1. Open a C project
  2. Place the cursor over any symbol
  3. Execute either lsp-find-references or xref-find-references command
  4. From *xref* buffer, execute xref-query-replace-in-results (bound to r key by default)
  5. At the second prompt, type any new name
  6. Get a "No suitable matches here" message

Expected behavior

xref-query-replace-in-results should perform the renaming inside each listed match.

Which Language Server did you use?

lsp-clangd

OS

Linux

Error callstack

No response

Anything else?

No response

@tekhnus tekhnus added the bug label Jul 14, 2021
@dgutov
Copy link

dgutov commented Oct 29, 2023

For this to work, the "find references" matches returned by lsp-mode should define the method xref-match-length.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants