feat(telescope): add mappings for specific symbol types in LSP
This commit introduces new key mappings for Telescope to filter document symbols by specific types such as methods, variables, and classes, enhancing the navigation experience by allowing users to efficiently find and access relevant code structures.
This commit is contained in:
parent
9b7605db11
commit
1a6c63949b
15
init.lua
15
init.lua
|
@ -554,6 +554,21 @@ require('lazy').setup({
|
|||
-- Symbols are things like variables, functions, types, etc.
|
||||
map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
||||
|
||||
map('<leader>dm', function()
|
||||
require('telescope.builtin').lsp_document_symbols {
|
||||
symbols = { 'function', 'method' }, -- Sets the query to 'method'
|
||||
}
|
||||
end, '[D]ocument [M]ethods')
|
||||
map('<leader>dv', function()
|
||||
require('telescope.builtin').lsp_document_symbols {
|
||||
symbols = 'variable', -- Sets the query to 'method'
|
||||
}
|
||||
end, '[D]ocument [V]ariable')
|
||||
map('<leader>dc', function()
|
||||
require('telescope.builtin').lsp_document_symbols {
|
||||
symbols = 'class', -- Sets the query to 'method'
|
||||
}
|
||||
end, '[D]ocument [C]lass')
|
||||
-- Fuzzy find all the symbols in your current workspace.
|
||||
-- Similar to document symbols, except searches over your entire project.
|
||||
map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
||||
|
|
Loading…
Reference in New Issue