Fix/improve declaration handling in lsp-ui-*find-*references#759
Open
jirassimok wants to merge 2 commits intoemacs-lsp:masterfrom
Open
Fix/improve declaration handling in lsp-ui-*find-*references#759jirassimok wants to merge 2 commits intoemacs-lsp:masterfrom
jirassimok wants to merge 2 commits intoemacs-lsp:masterfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request contains a bugfix and a small improvement.
Last year,
lsp--make-reference-paramshad 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.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 allowslsp-ui-peek-always-showto work normally when trying to navigate from a definition to the only usage of the identifier.lsp-ui-find-{next,prev}-reference, I changed the name of the argument toexclude-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.