Open ghost opened 2 years ago
This plugin works with any LSP server that supports textDocument/codeLens
.
Please check the documentation of rust-analyzer
to make sure that it supports textDocument/codeLens
request, and you have configured it correctly.
@henriquehbr @sbaildon @beauwilliams have you guys got this plugin working with rust-analyzer? If yes, care to share the code for it?
I expected types to show up in virtual text, but I only can see run commands at the top of the file.
textDocument/codeLens
in rust_analyzer not show type hints, he providers command to build, debug and tests.
Type hints in rust_analyzer is supported by experimental/inlayHints
. See https://github.com/simrat39/rust-tools.nvim/ plugin.
LSP espeficifcation for 3.17: https://github.com/microsoft/language-server-protocol/issues/956
ocamllsp
has not yet implemented the type hint feature in the textDocument/inlayHints
method, so some servers show a different result.
Neovim has built-in support for codelens.
local on_attach = function(client, bufnr)
--- Only Neovim 0.7
if client.resolved_capabilities.code_lens then
local codelens = vim.api.nvim_create_augroup(
'LSPCodeLens',
{ clear = true }
)
vim.api.nvim_create_autocmd({ 'BufEnter' }, {
group = codelens,
callback = function()
vim.lsp.codelens.refresh()
end,
buffer = bufnr,
once = true,
})
vim.api.nvim_create_autocmd({ 'BufWritePost', 'CursorHold' }, {
group = codelens,
callback = function()
vim.lsp.codelens.refresh()
end,
buffer = bufnr,
})
end
end
I've followed readme instructions step by step, installed
virtual-types.nvim
, included theon_attach
snippet, but it simply doesn't works, no error or warning output is displayed, but the virtual texts aren't showing up when i open a.rs
fileNot sure if this is relevant, but I'm using
nvim-lspinstall
for easing the process of setting up language serversHere's my system details: