lsp-ui icon indicating copy to clipboard operation
lsp-ui copied to clipboard

Fix/improve declaration handling in lsp-ui-*find-*references

Open jirassimok opened this issue 1 year ago • 0 comments

This pull request contains a bugfix and a small improvement.

Last year, lsp--make-reference-params had its parameter reversed in emacs-lsp/lsp-mode@2c6a0e92, but no matching change was made here, so the behavior of a few functions became incorrect. The first commit in this pull request fixes those functions.

  • For lsp-ui-peek-find-references, I left the argument name intact and reversed the value, which restores the previous behavior of not including the declaration by default. This allows lsp-ui-peek-always-show to work normally when trying to navigate from a definition to the only usage of the identifier.
  • For lsp-ui-find-{next,prev}-reference, I changed the name of the argument to exclude-declaration, which leaves the previous behavior intact (they include the declaration).

The second commit adds a prefix argument to lsp-ui-peek-find-references, allowing a prefix argument to be given to include the declaration in the search, just in case you want to see the definition and references at the same time.

jirassimok avatar Nov 17 '23 15:11 jirassimok