fix(lsp): detect if using nvim-0.10 and use new inlay_hint.enable method (#2007)

* Detect if using nvim 0.10 and use new inlay_hint.enable method

* Add lsp util for inlay-hints and update keymap

* Remove the need to check vim version

* Support older nightly builds

* Move inlay_hint toggle in Util.toggle

---------

Co-authored-by: Gary Murray <gamurray@fanatics.com>
This commit is contained in:
Gary Murray
2023-11-30 11:53:40 -07:00
committed by GitHub
parent 68ff818a5b
commit 6853b785d9
3 changed files with 14 additions and 3 deletions

View File

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