@@ -239,14 +239,8 @@ require'navigator'.setup({
239
239
preview_height = 0.35 , -- max height of preview windows
240
240
border = {" ╭" , " ─" , " ╮" , " │" , " ╯" , " ─" , " ╰" , " │" }, -- border style, can be one of 'none', 'single', 'double',
241
241
-- 'shadow', or a list of chars which defines the border
242
- on_attach = function (client , bufnr )
243
- -- your hook
242
+ on_attach = function (client , bufnr ) -- no longer supported for nvim > 0.11 use your own LspAttach autocmd
244
243
end ,
245
- -- put a on_attach of your own here, e.g
246
- -- function(client, bufnr)
247
- -- -- the on_attach will be called at end of navigator on_attach
248
- -- end,
249
- -- The attach code will apply to all LSP clients
250
244
251
245
ts_fold = {
252
246
enable = false ,
@@ -284,7 +278,7 @@ require'navigator'.setup({
284
278
separator = ' ' , -- e.g. shows 3 lines
285
279
},
286
280
},
287
- mason = false , -- set to true if you would like use the lsp installed by williamboman/mason
281
+ mason = false , -- Deprecated, mason no longer supported as setup lsp changed in nvim 0.11
288
282
lsp = {
289
283
enable = true , -- skip lsp setup, and only use treesitter in navigator.
290
284
-- Use this if you are not using LSP servers, and only want to enable treesitter support.
@@ -351,42 +345,23 @@ require'navigator'.setup({
351
345
diagnostic_update_in_insert = false , -- update diagnostic message in insert mode
352
346
display_diagnostic_qf = true , -- always show quickfix if there are diagnostic errors, set to false if you want to ignore it
353
347
-- set to 'trouble' to show diagnostcs in Trouble
354
- ts_ls = {
355
- filetypes = {' typescript' } -- disable javascript etc,
356
- -- set to {} to disable the lspclient for all filetypes
357
- },
358
348
ctags = {
359
349
cmd = ' ctags' ,
360
350
tagfile = ' tags' ,
361
351
options = ' -R --exclude=.git --exclude=node_modules --exclude=test --exclude=vendor --excmd=number' ,
362
352
},
363
- gopls = { -- gopls setting
364
- on_attach = function (client , bufnr ) -- on_attach for gopls
365
- -- your special on attach here
366
- -- e.g. disable gopls format because a known issue https://github.com/golang/go/issues/45732
367
- print (" i am a hook, I will disable document format" )
368
- client .resolved_capabilities .document_formatting = false
369
- end ,
370
- settings = {
371
- gopls = {gofumpt = false } -- disable gofumpt etc,
372
- }
353
+ -- lsp setup and config no longer supported for nvim 0.11
354
+ -- refer to nvim 0.11 lsp setup doc and lspconfig for more info
355
+ ts_ls = { -- no longer supported for nvim 0.11
356
+ },
357
+ gopls = { -- no longer supported for nvim 0.11
373
358
},
374
359
-- the lsp setup can be a function, .e.g
375
- gopls = function ()
376
- local go = pcall (require , " go" )
377
- if go then
378
- local cfg = require (" go.lsp" ).config ()
379
- cfg .on_attach = function (client )
380
- client .server_capabilities .documentFormattingProvider = false -- efm/null-ls
381
- end
382
- return cfg
383
- end
360
+ gopls = function () -- no longer supported for nvim 0.11
384
361
end ,
385
362
386
- lua_ls = {
387
- sumneko_root_path = vim .fn .expand (" $HOME" ) .. " /github/sumneko/lua-language-server" ,
388
- sumneko_binary = vim .fn .expand (" $HOME" ) .. " /github/sumneko/lua-language-server/bin/macOS/lua-language-server" ,
389
- },
363
+ lua_ls = { }, -- no longer supported
364
+
390
365
servers = {' cmake' , ' ltex' }, -- by default empty, and it should load all LSP clients available based on filetype
391
366
-- but if you want navigator load e.g. `cmake` and `ltex` for you , you
392
367
-- can put them in the `servers` list and navigator will auto load them.
@@ -569,107 +544,13 @@ Terminal nerdfont and emoji capacity. I am using Kitty with nerdfont (Victor Mon
569
544
570
545
## Integrate with williamboman/mason.nvim
571
546
572
- If you are using mason and would like to use the lsp servers installed by mason. Please set
573
-
574
- ``` lua
575
- mason = true -- mason user
576
- ```
577
-
578
- In the config. Also please setup the lsp server from installer setup with ` server:setup{opts} `
579
-
580
- for mason
547
+ Note: mason lspconfig no longger support as of navigator nvim 0.11 branch The only change you need in in LspAttach event
548
+ add if you prefer to use mason lspconfig
581
549
582
550
``` lua
583
- use (" williamboman/mason.nvim" )
584
- use ({
585
- " williamboman/mason-lspconfig.nvim" ,
586
- config = function ()
587
- require (" mason" ).setup ()
588
- require (" mason-lspconfig" ).setup ({})
589
- end ,
590
- })
591
-
592
- use ({
593
- " ray-x/navigator.lua" ,
594
- requires = {
595
- { " ray-x/guihua.lua" , run = " cd lua/fzy && make" },
596
- { " neovim/nvim-lspconfig" },
597
- { " nvim-treesitter/nvim-treesitter" },
598
- },
599
- config = function ()
600
- require (" navigator" ).setup ({
601
- mason = true ,
602
- })
603
- end ,
604
- })
605
- ```
606
-
607
- Another way to setup mason is disable navigator lsp setup and using mason setup handlers, pylsp for example
608
-
609
- ``` lua
610
- use (" williamboman/mason.nvim" )
611
- use ({
612
- " williamboman/mason-lspconfig.nvim" ,
613
- config = function ()
614
- require (" mason" ).setup ()
615
- require (" mason-lspconfig" ).setup_handlers ({
616
- [" pylsp" ] = function ()
617
- require (" lspconfig" ).pylsp .setup ({
618
- on_attach = function (client , bufnr )
619
- require (" navigator.lspclient.mapping" ).setup ({ client = client , bufnr = bufnr }) -- setup navigator keymaps here,
620
- require (" navigator.dochighlight" ).documentHighlight (bufnr )
621
- require (" navigator.codeAction" ).code_action_prompt (client , bufnr )
622
- end ,
623
- })
624
- end ,
625
- })
626
- require (" mason-lspconfig" ).setup ({})
627
- end ,
628
- })
629
-
630
- use ({
631
- " navigator.lua" ,
632
- requires = {
633
- { " ray-x/guihua.lua" , run = " cd lua/fzy && make" },
634
- { " nvim-lspconfig" },
635
- { " nvim-treesitter/nvim-treesitter" },
636
- },
637
- config = function ()
638
- require (" navigator" ).setup ({
639
- mason = true ,
640
- lsp = { disable_lsp = { " pylsp" } }, -- disable pylsp setup from navigator
641
- })
642
- end ,
643
- })
644
- ```
645
-
646
- Alternatively, Navigator can be used to startup the server installed by mason. as it will override the navigator setup
647
-
648
- To start LSP installed by mason, please use following setups
649
-
650
- ``` lua
651
- require ' navigator' .setup ({
652
- -- mason = false -- default value is false
653
- lsp = {
654
- ts_ls = { cmd = {' your typescript-language-server installed by mason' } }
655
- -- e.g. ts_ls = { cmd = {'/home/username/.local/share/nvim/mason/packages/typescript-language-server/node_modules/typescript/bin/typescript-language-server'} }
656
-
657
- }
658
- })
659
- ```
660
-
661
- example cmd setup (mac) for pyright :
662
-
663
- ``` lua
664
- require ' navigator' .setup ({
665
- -- mason = false -- default value is false
666
-
667
- lsp = {
668
- pyright = {
669
- cmd = { " /Users/username/.local/share/nvim/lsp_servers/python/node_modules/.bin/pyright-langserver" , " --stdio" }
670
- }
671
- }
672
- }
551
+ require (" navigator.lspclient.mapping" ).setup ({ client = client , bufnr = bufnr }) -- setup navigator keymaps here,
552
+ require (" navigator.dochighlight" ).documentHighlight (bufnr )
553
+ require (" navigator.codeAction" ).code_action_prompt (client , bufnr )
673
554
```
674
555
675
556
### Integration with other lsp plugins (e.g. rust-tools, go.nvim, clangd extension)
@@ -697,7 +578,7 @@ use {"ray-x/navigator.lua",
697
578
}
698
579
```
699
580
700
- - Here is an example to setup rust with rust-tools
581
+ - Here is an example to setup rust with rust-tools (nvim < 0.11)
701
582
702
583
``` lua
703
584
require (' rust-tools' ).setup ({
@@ -706,7 +587,7 @@ require('rust-tools').setup({
706
587
require (' navigator.lspclient.mapping' ).setup ({client = client , bufnr = bufnr }) -- setup navigator keymaps here,
707
588
708
589
require (" navigator.dochighlight" ).documentHighlight (bufnr )
709
- require (' navigator.codeAction' ).code_action_prompt (bufnr )
590
+ require (' navigator.codeAction' ).code_action_prompt (client , bufnr )
710
591
-- otherwise, you can define your own commands to call navigator functions
711
592
end ,
712
593
}
@@ -717,7 +598,7 @@ require("clangd_extensions").setup {
717
598
on_attach = function (client , bufnr )
718
599
require (' navigator.lspclient.mapping' ).setup ({client = client , bufnr = bufnr }) -- setup navigator keymaps here,
719
600
require (" navigator.dochighlight" ).documentHighlight (bufnr )
720
- require (' navigator.codeAction' ).code_action_prompt (bufnr )
601
+ require (' navigator.codeAction' ).code_action_prompt (client , bufnr )
721
602
-- otherwise, you can define your own commands to call navigator functions
722
603
end ,
723
604
}
0 commit comments