feat(lsp): incremental selection via "textDocument/selectionRange" #34011

Select outwards with "an" and inwards with "in" in Visual mode.
Ranges are reset when leaving Visual mode.
This commit is contained in:
Riley Bruins
2025-06-12 09:25:19 -07:00
committed by GitHub
parent a9b8a8dc6c
commit f99e3a8a2a
5 changed files with 141 additions and 1 deletions

View File

@@ -209,6 +209,14 @@ do
vim.lsp.buf.implementation()
end, { desc = 'vim.lsp.buf.implementation()' })
vim.keymap.set('x', 'an', function()
vim.lsp.buf.selection_range('outer')
end, { desc = "vim.lsp.buf.selection_range('outer')" })
vim.keymap.set('x', 'in', function()
vim.lsp.buf.selection_range('inner')
end, { desc = "vim.lsp.buf.selection_range('inner')" })
vim.keymap.set('n', 'gO', function()
vim.lsp.buf.document_symbol()
end, { desc = 'vim.lsp.buf.document_symbol()' })