Testing inlay hints

This commit is contained in:
Luke Else 2023-03-16 22:09:15 +00:00
parent c2e317519a
commit 728a6bd880

View File

@ -1,7 +1,20 @@
require'lsp_extensions'.inlay_hints{
highlight = "Comment",
prefix = " > ",
aligned = false,
only_current_line = false,
enabled = {"TypeHint", "ChainingHint", "ParameterHint"}
}
local inlay_hints = require('lsp_extensions.inlay_hints')
local M = {}
-- Global function, so you can just call it on the lua side
ShowInlineInlayHints = function()
vim.lsp.buf_request(0, 'rust-analyzer/inlayHints', inlay_hints.get_params(), inlay_hints.get_callback {
only_current_line = true
})
end
-- @rockerboo
M.show_line_hints_on_cursor_events = function()
vim.cmd [[augroup ShowLineHints]]
vim.cmd [[ au!]]
vim.cmd [[ autocmd CursorHold,CursorHoldI,CursorMoved *.rs :lua ShowInlineInlayHints()]]
vim.cmd [[augroup END]]
end
return M