fix(lsp): upstream inlay_hint rename

This commit is contained in:
Folke Lemaitre 2023-06-30 20:44:39 +02:00
parent 6d8be7ae46
commit 089606b48d
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 6 additions and 4 deletions

View file

@ -112,8 +112,8 @@ map("n", "<leader>ul", function() Util.toggle("relativenumber", true) Util.toggl
map("n", "<leader>ud", Util.toggle_diagnostics, { desc = "Toggle Diagnostics" }) map("n", "<leader>ud", Util.toggle_diagnostics, { desc = "Toggle Diagnostics" })
local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3 local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3
map("n", "<leader>uc", function() Util.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" }) map("n", "<leader>uc", function() Util.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
if vim.lsp.buf.inlay_hint then if vim.lsp.inlay_hint then
map("n", "<leader>uh", function() vim.lsp.buf.inlay_hint(0, nil) end, { desc = "Toggle Inlay Hints" }) map("n", "<leader>uh", function() vim.lsp.inlay_hint(0, nil) end, { desc = "Toggle Inlay Hints" })
end end
-- lazygit -- lazygit

View file

@ -98,10 +98,12 @@ return {
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
end end
if opts.inlay_hints.enabled and vim.lsp.buf.inlay_hint then local inlay_hint = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint
if opts.inlay_hints.enabled and inlay_hint then
Util.on_attach(function(client, buffer) Util.on_attach(function(client, buffer)
if client.server_capabilities.inlayHintProvider then if client.server_capabilities.inlayHintProvider then
vim.lsp.buf.inlay_hint(buffer, true) inlay_hint(buffer, true)
end end
end) end)
end end