@@ -591,26 +591,13 @@ require('lazy').setup({
591
591
-- Toggle to show/hide diagnostic messages
592
592
map (' <leader>td' , function () vim .diagnostic .enable (not vim .diagnostic .is_enabled ()) end , ' [T]oggle [D]iagnostics' )
593
593
594
- -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
595
- --- @param client vim.lsp.Client
596
- --- @param method vim.lsp.protocol.Method
597
- --- @param bufnr ? integer some lsp support methods only in specific files
598
- --- @return boolean
599
- local function client_supports_method (client , method , bufnr )
600
- if vim .fn .has ' nvim-0.11' == 1 then
601
- return client :supports_method (method , bufnr )
602
- else
603
- return client .supports_method (method , { bufnr = bufnr })
604
- end
605
- end
606
-
607
594
-- The following two autocommands are used to highlight references of the
608
595
-- word under your cursor when your cursor rests there for a little while.
609
596
-- See `:help CursorHold` for information about when this is executed
610
597
--
611
598
-- When you move your cursor, the highlights will be cleared (the second autocommand).
612
599
local client = vim .lsp .get_client_by_id (event .data .client_id )
613
- if client and client_supports_method ( client , vim .lsp .protocol .Methods .textDocument_documentHighlight , event .buf ) then
600
+ if client and client : supports_method ( vim .lsp .protocol .Methods .textDocument_documentHighlight , event .buf ) then
614
601
local highlight_augroup = vim .api .nvim_create_augroup (' kickstart-lsp-highlight' , { clear = false })
615
602
vim .api .nvim_create_autocmd ({ ' CursorHold' , ' CursorHoldI' }, {
616
603
buffer = event .buf ,
@@ -637,7 +624,7 @@ require('lazy').setup({
637
624
-- code, if the language server you are using supports them
638
625
--
639
626
-- This may be unwanted, since they displace some of your code
640
- if client and client_supports_method ( client , vim .lsp .protocol .Methods .textDocument_inlayHint , event .buf ) then
627
+ if client and client : supports_method ( vim .lsp .protocol .Methods .textDocument_inlayHint , event .buf ) then
641
628
map (' <leader>th' , function () vim .lsp .inlay_hint .enable (not vim .lsp .inlay_hint .is_enabled { bufnr = event .buf }) end , ' [T]oggle Inlay [H]ints' )
642
629
end
643
630
end ,
0 commit comments