@@ -7,12 +7,33 @@ return {
77 opts = {
88 library = {
99 { path = ' ${3rd}/luv/library' , words = { ' vim%.uv' } },
10+ { path = ' snacks.nvim' , words = { ' Snacks' } },
1011 },
1112 },
1213 },
1314 {
1415 ' folke/trouble.nvim' ,
1516 opts = {},
17+ specs = {
18+ ' folke/snacks.nvim' ,
19+ opts = function (_ , opts )
20+ return vim .tbl_deep_extend (' force' , opts or {}, {
21+ picker = {
22+ actions = require (' trouble.sources.snacks' ).actions ,
23+ win = {
24+ input = {
25+ keys = {
26+ [' <c-t>' ] = {
27+ ' trouble_open' ,
28+ mode = { ' n' , ' i' },
29+ },
30+ },
31+ },
32+ },
33+ },
34+ })
35+ end ,
36+ },
1637 cmd = ' Trouble' ,
1738 keys = {
1839 {
@@ -119,33 +140,32 @@ return {
119140 -- Jump to the definition of the word under your cursor.
120141 -- This is where a variable was first declared, or where a function is defined, etc.
121142 -- To jump back, press <C-t>.
122- map (' gd' , deprecated (' grd' , require (' telescope.builtin ' ) .lsp_definitions ), ' Goto Definition' )
123- map (' grd' , require (' telescope.builtin ' ) .lsp_definitions , ' Goto Definition' )
143+ map (' gd' , deprecated (' grd' , require (' snacks ' ). picker .lsp_definitions ), ' Goto Definition' )
144+ map (' grd' , require (' snacks ' ). picker .lsp_definitions , ' Goto Definition' )
124145
125146 -- Find references for the word under your cursor.
126- map (' grr' , require (' telescope.builtin ' ) .lsp_references , ' Goto References' )
147+ map (' grr' , require (' snacks ' ). picker .lsp_references , ' Goto References' )
127148
128149 -- Jump to the implementation of the word under your cursor.
129150 -- Useful when your language has ways of declaring types without an actual implementation.
130- map (' gI' , deprecated (' gri' , require (' telescope.builtin' ).lsp_implementations ), ' Goto Implementation' )
131- map (' gri' , require (' telescope.builtin' ).lsp_implementations , ' Goto Implementation' )
151+ map (' gri' , require (' snacks' ).picker .lsp_implementations , ' Goto Implementation' )
132152
133153 -- Jump to the type of the word under your cursor.
134154 -- Useful when you're not sure what type a variable is and you want to see
135155 -- the definition of its *type*, not where it was *defined*.
136- map (' grt' , require (' telescope.builtin ' ) .lsp_type_definitions , ' Type Definition' )
156+ map (' grt' , require (' snacks ' ). picker .lsp_type_definitions , ' Type Definition' )
137157
138158 map (' <leader>ld' , vim .diagnostic .open_float , ' Open diagnostic in float' )
139159
140160 -- Fuzzy find all the symbols in your current document.
141161 -- Symbols are things like variables, functions, types, etc.
142- map (' <leader>ls' , deprecated (' gD' , require (' telescope.builtin ' ).lsp_document_symbols ), ' Document Symbols' )
143- map (' gD' , require (' telescope.builtin ' ).lsp_document_symbols , ' Document Symbols' )
162+ map (' <leader>ls' , deprecated (' gD' , require (' snacks ' ).picker . lsp_symbols ), ' Document Symbols' )
163+ map (' gD' , require (' snacks ' ).picker . lsp_symbols , ' Document Symbols' )
144164
145165 -- Fuzzy find all the symbols in your current workspace.
146166 -- Similar to document symbols, except searches over your entire project.
147- map (' <leader>lS' , deprecated (' gW' , require (' telescope.builtin ' ).lsp_dynamic_workspace_symbols ), ' Workspace Symbols' )
148- map (' gW' , require (' telescope.builtin ' ).lsp_dynamic_workspace_symbols , ' Workspace Symbols' )
167+ map (' <leader>lS' , deprecated (' gW' , require (' snacks ' ).picker . lsp_workspace_symbols ), ' Workspace Symbols' )
168+ map (' gW' , require (' snacks ' ).picker . lsp_workspace_symbols , ' Workspace Symbols' )
149169
150170 -- Rename the variable under your cursor.
151171 -- Most Language Servers support renaming across files, etc.
@@ -168,8 +188,10 @@ return {
168188 --- @return boolean
169189 local function client_supports_method (client , method , bufnr )
170190 if vim .fn .has ' nvim-0.11' == 1 then
191+ --- @diagnostic disable-next-line : param-type-mismatch
171192 return client :supports_method (method , bufnr )
172193 else
194+ --- @diagnostic disable-next-line : param-type-mismatch
173195 return client .supports_method (method , { bufnr = bufnr })
174196 end
175197 end
0 commit comments