commit 5d7c875526d43235b9cf4f3be508b40bde83d9cb
parent 4d81efa31248dad8f90134a04eb7a7144f1fa697
Author: Alex Balgavy <alex@balgavy.eu>
Date: Sun, 18 Feb 2024 12:15:48 +0100
nvim: add notification when inlay hints are supported
Diffstat:
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/nvim/init.lua b/nvim/init.lua
@@ -79,3 +79,14 @@ require('llm')
vim.cmd ([[
nnoremap <leader><C-e><C-u> :<c-u>exe "vsplit ~/.vim/snippets/"..&filetype..".snippets"<CR>
]])
+
+vim.api.nvim_create_autocmd('LspAttach', {
+ group = vim.api.nvim_create_augroup('UserLspConfig', {}),
+ callback = function(ev)
+ local client = vim.lsp.get_client_by_id(ev.data.client_id)
+ if client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then
+ vim.notify("Nvim now has support for inlay hints")
+ -- vim.lsp.inlay_hint.enable(ev.buf, true)
+ end
+ end,
+})