File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 7777--- @param bufnr integer The buffer that the LSP client is attaching to
7878function M .on_attach (client , bufnr )
7979 if client :supports_method (" textDocument/codeLens" , bufnr ) and M .config .features .codelens then
80- vim .lsp .codelens .refresh { bufnr = bufnr }
80+ -- TODO: remove check when dropping support for Neovim v0.11
81+ if vim .lsp .codelens .enable then
82+ vim .lsp .codelens .enable (true , { bufnr = bufnr })
83+ else
84+ vim .lsp .codelens .refresh { bufnr = bufnr }
85+ end
8186 end
8287
8388 local formatting_disabled = vim .tbl_get (M .config , " formatting" , " disabled" )
Original file line number Diff line number Diff line change 9999--- @param silent ? boolean if true then don ' t sent a notification
100100function M .codelens (silent )
101101 features .codelens = not features .codelens
102- if not features .codelens then vim .lsp .codelens .clear () end
102+ -- TODO: remove check when dropping support for Neovim v0.11
103+ if vim .lsp .codelens .enable then
104+ vim .lsp .codelens .enable (features .codelens )
105+ else
106+ if not features .codelens then vim .lsp .codelens .clear () end
107+ end
103108 ui_notify (silent , (" CodeLens %s" ):format (bool2str (features .codelens )))
104109end
105110
You can’t perform that action at this time.
0 commit comments