I have attempted to setup inlayHints with rust-analyzer, however, it doesn't show me the inlayHints. I would like to maintain the debugging hints, but also possibly add type hints after the variable declaration, such as done in RustRover.
config:
lsp = require('lsp-zero')
lsp.preset('recommended')
lsp.ensure_installed({
'rust_analyzer',
})
-- Rust
local on_attach = {
function(client)
require'completion'.on_attach(client)
end
}
lsp.configure('rust_analyzer', {
on_attach=on_attach,
settings = {
["rust-analyzer"] = {
imports = {
granularity = {
group = "module",
},
prefix = "self",
},
cargo = {
buildScripts = {
enable = true,
},
},
procMacro = {
enable = true
},
add_return_type = {
enable = true
},
inlayHints = {
enable = true,
showParameterNames = true,
parameterHintsPrefix = "<- ",
otherHintsPrefix = "=> ",
},
}
}
})
lsp.setup()
vim.diagnostic.config({
virtual_text = true
})
NOTE: I would like to keep rustc debugging hints.
Currently what I'm seeing:


After researching further, I came to realisation that this is achievable using the following plugin: https://github.com/simrat39/rust-tools.nvim#configuration and following configuration: