@@ -595,26 +595,13 @@ require('lazy').setup({
595595 -- Toggle to show/hide diagnostic messages
596596 map (' <leader>td' , function () vim .diagnostic .enable (not vim .diagnostic .is_enabled ()) end , ' [T]oggle [D]iagnostics' )
597597
598- -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
599- --- @param client vim.lsp.Client
600- --- @param method vim.lsp.protocol.Method
601- --- @param bufnr ? integer some lsp support methods only in specific files
602- --- @return boolean
603- local function client_supports_method (client , method , bufnr )
604- if vim .fn .has ' nvim-0.11' == 1 then
605- return client :supports_method (method , bufnr )
606- else
607- return client .supports_method (method , { bufnr = bufnr })
608- end
609- end
610-
611598 -- The following two autocommands are used to highlight references of the
612599 -- word under your cursor when your cursor rests there for a little while.
613600 -- See `:help CursorHold` for information about when this is executed
614601 --
615602 -- When you move your cursor, the highlights will be cleared (the second autocommand).
616603 local client = vim .lsp .get_client_by_id (event .data .client_id )
617- if client and client_supports_method ( client , vim .lsp .protocol .Methods .textDocument_documentHighlight , event .buf ) then
604+ if client and client : supports_method ( vim .lsp .protocol .Methods .textDocument_documentHighlight , event .buf ) then
618605 local highlight_augroup = vim .api .nvim_create_augroup (' kickstart-lsp-highlight' , { clear = false })
619606 vim .api .nvim_create_autocmd ({ ' CursorHold' , ' CursorHoldI' }, {
620607 buffer = event .buf ,
@@ -641,7 +628,7 @@ require('lazy').setup({
641628 -- code, if the language server you are using supports them
642629 --
643630 -- This may be unwanted, since they displace some of your code
644- if client and client_supports_method ( client , vim .lsp .protocol .Methods .textDocument_inlayHint , event .buf ) then
631+ if client and client : supports_method ( vim .lsp .protocol .Methods .textDocument_inlayHint , event .buf ) then
645632 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' )
646633 end
647634 end ,
0 commit comments