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

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jirassimok
Copy link

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.

The definition of that function was changed in
emacs-lsp/lsp-mode@2c6a0e92 to reverse the meaning of the parameter,
so here we have to reverse the value we pass in.

This restores the previous behavior of not including declarations in
lsp-ui-peek-find-references by default.

For lsp-ui-find-{next,prev}-reference, reverse the parameters instead,
assuming that when cycling through references, the definition should
be included.
@jirassimok jirassimok changed the title Fix/improve declaration handling in lsp-ui-peek-find-references Fix/improve declaration handling in lsp-ui-*find*-references Nov 17, 2023
@jirassimok jirassimok changed the title Fix/improve declaration handling in lsp-ui-*find*-references Fix/improve declaration handling in lsp-ui-*find-*references Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant