Update to use the new api for inlay hints that cme with 0.10
This commit is contained in:
parent
007ade1369
commit
9d6927225c
3 changed files with 4 additions and 4 deletions
|
|
@ -1,7 +1,7 @@
|
|||
local buffers_without_inlay_hints = {}
|
||||
local function set_inlay_hints_active(buffers, enable)
|
||||
for _, bufnr in pairs(buffers) do
|
||||
vim.lsp.inlay_hint.enable(bufnr, enable)
|
||||
vim.lsp.inlay_hint.enable(enable, { burfnr = bufnr })
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -9,7 +9,7 @@ local function get_open_buffers_with_inlay_hints()
|
|||
local buffers = {}
|
||||
for _, win in ipairs(vim.api.nvim_list_wins()) do
|
||||
local bufnr = vim.api.nvim_win_get_buf(win)
|
||||
if vim.lsp.inlay_hint.is_enabled(bufnr) then
|
||||
if vim.lsp.inlay_hint.is_enabled({ bufnr = bufnr }) then
|
||||
table.insert(buffers, bufnr)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ local function setup_lsp(server_names)
|
|||
local server_table = require("language_servers/" .. server_name)
|
||||
server_table.capabilities = capabilities
|
||||
server_table.on_attach = function(client, bufnr)
|
||||
vim.lsp.inlay_hint.enable(bufnr, true)
|
||||
vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
|
||||
|
||||
if client.server_capabilities.documentFormattingProvider then
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "Format", vim.lsp.buf.format, { nargs = 0 })
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ return {
|
|||
},
|
||||
server = {
|
||||
on_attach = function(client, bufnr)
|
||||
vim.lsp.inlay_hint.enable(bufnr, true)
|
||||
vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
|
||||
|
||||
if client.server_capabilities.documentFormattingProvider then
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "Format", vim.lsp.buf.format, { nargs = 0 })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue