feat(lsp-jump-type): tab drop
as new jump_type
option for go-to
LSP pickers
#2751
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.
Description
Sometimes when I'm coding I want to jump to a definition using the command
builtin.lsp_definitions
, for example, and it adds a new buffer on top of the buffer I'm working on. This behavior is something I don't like, so I started reading the documentation for changing that behavior and I found a parameter calledjump_type
and I set it totab
. However, there is another problem: when I jump to a definition, it adds a new tab buffer, but, if that tab buffer is already opened, it does not jump to it, it adds a new one. So, the behavior that I was looking for only exists with the commandtab drop
, so I added it to the list of options for thejump_type
parameter of the following commands:builtin.lsp_type_definitions
,builtin.lsp_implementations
,builtin.lsp_references
andbuiltin.lsp_definitions
.NOTE: I'm using native Neovim tabs, not the plugin
bufferline
.Type of change
How Has This Been Tested?
nvim-lspconfig
for providing LSP features,tab drop
asjump_type
option in the following Telescope LSP pickers:builtin.lsp_type_definitions
,builtin.lsp_implementations
,builtin.lsp_references
andbuiltin.lsp_definitions
, andpyright
as my Python language server, I have some files that import things from each other, and I tried to usebuiltin.lsp_definitions
feature for going to the definition of some random class defined in other file, and it opened a new tab buffer (like expected). After this, I left the definition tab buffer opened and used the same command for going to the definition, and it jumped to the existing buffer instead of adding a new one. Additionally, I tried some equivalent example in some Golang code usinggopls
as my language server and it worked perfectly as well. It worked well for the remaining LSP pickers.Configuration:
Neovim version (nvim --version):
Operating system and version:
Checklist: