feat(neovim-rust): Rust LSP, debugging, testing and keymaps

- `rustaceanvim` for LSP config
- Rust ft specific keymaps in `after/ftplugin`
- `nvim-dap` for Rust debugging with codelldb
- `rustaceanvim.neotest` for Rust testing
- `rcasia/neotest-bash` for Bash testing
- Better keymaps for running tests
- Inlay hint UI improvements
This commit is contained in:
Pratik Tripathy
2025-07-29 11:25:08 +05:30
parent fb16a6a3f0
commit 8c52c7a881
7 changed files with 250 additions and 32 deletions

View File

@@ -58,12 +58,60 @@ return {
},
},
-- NeoVim
{ "folke/lazydev.nvim", ft = "lua" },
-- Rust
{
"mrcjkb/rustaceanvim",
version = "^6",
config = function()
vim.g.rusteceanvim = {
lazy = false,
init = function()
vim.g.rustaceanvim = {
server = {
-- Keymaps in ../../after/ftplugin/rust.lua
-- LSP configuration
default_settings = {
["rust-analyzer"] = {
cargo = { allFeatures = true },
diagnostics = {
enable = true,
enableExperimental = true,
},
completion = {
addCallArgumentSnippets = true,
addCallParenthesis = true,
postfix = { enable = true },
autoimport = { enable = true },
},
},
inlayHints = {
bindingModeHints = { enable = false },
chainingHints = { enable = true },
closingBraceHints = { enable = true, minLines = 25 },
closureReturnTypeHints = { enable = "never" },
lifetimeElisionHints = { enable = "never", useParameterNames = false },
maxLength = 25,
parameterHints = { enable = true },
reborrowHints = { enable = "never" },
renderColons = true,
typeHints = {
enable = true,
hideClosureInitialization = false,
hideNamedConstructor = false,
},
},
procMacro = {
enable = true,
ignored = {
["async-trait"] = { "async_trait" },
["napi-derive"] = { "napi" },
["async-recursion"] = { "async_recursion" },
},
},
},
},
dap = {
adapter = {
type = "executable",