feat: fix lsp inlay hints
This commit is contained in:
parent
33bd78ed9f
commit
18e6882d0e
2 changed files with 4 additions and 2 deletions
|
@ -16,7 +16,7 @@ function M.on_attach(client, bufnr)
|
||||||
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
|
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||||
|
|
||||||
if user_config.lsp.inlay_hint and client.supports_method('textDocument/inlayHint') then
|
if user_config.lsp.inlay_hint and client.supports_method('textDocument/inlayHint') then
|
||||||
vim.lsp.inlay_hint(bufnr, true)
|
vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
|
||||||
end
|
end
|
||||||
|
|
||||||
if client.supports_method('textDocument/formatting') then
|
if client.supports_method('textDocument/formatting') then
|
||||||
|
|
|
@ -101,7 +101,9 @@ function M.toggle_inlay_hints()
|
||||||
local enabled = user_config.lsp.inlay_hint
|
local enabled = user_config.lsp.inlay_hint
|
||||||
return function()
|
return function()
|
||||||
enabled = not enabled
|
enabled = not enabled
|
||||||
vim.lsp.inlay_hint(vim.api.nvim_get_current_buf() or 0, enabled)
|
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({
|
||||||
|
bufnr = vim.api.nvim_get_current_buf() or 0,
|
||||||
|
}))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue