Error while migrating from rust-tools #127
Answered
by
mrcjkb
Blonteractor
asked this question in
Q&A
-
Neovim version (nvim -v)v0.9.5 Operating system/versionMacOS 14.0 Output of :checkhealth rustaceanvimrustaceanvim: require("rustaceanvim.health").check()
- ERROR Failed to run healthcheck for "rustaceanvim" plugin. Exception:
function health#check, line 25
Vim(eval):E5108: Error executing lua ...share/nvim/lazy/rustaceanvim/lua/rustaceanvim/health.lua:134: loop or previous error loading module 'rustaceanvim.config.internal'
stack traceback:
[C]: in function 'require'
...share/nvim/lazy/rustaceanvim/lua/rustaceanvim/health.lua:134: in function 'check'
[string "luaeval()"]:1: in main chunk How to reproduce the issuecargo new --bin foo
cd foo
nvim src/main.rs Expected behaviourThe plugin should load normally. Actual behaviourErrors out when opening any rust file.
The minimal config used to reproduce this issue.I followed LazyVim/LazyVim#2198 {
"mrcjkb/rustaceanvim",
version = "^3",
ft = { "rust" },
opts = {
server = function(_, bufnr)
local wk = require "which-key"
wk.register({
["<leader>ca"] = {
function()
vim.cmd.RustLsp "codeAction"
end,
"Code Action",
},
["<leader>dr"] = {
function()
vim.cmd.RustLsp "debuggables"
end,
"Rust debuggables",
},
}, { mode = "n", buffer = bufnr })
end,
settings = {
["rust-analyzer"] = {
cargo = {
allFeatures = true,
loadOutDirsFromCheck = true,
runBuildScripts = true,
},
checkOnSave = {
allFeatures = true,
command = "clippy",
extraArgs = { "--no-deps" },
},
procMacro = {
enable = true,
ignored = {
["async-trait"] = { "async_trait" },
["napi-derive"] = { "napi" },
["async-recursion"] = { "async_recursion" },
},
},
},
},
},
config = function(_, opts)
vim.g.rustaceanvim = vim.tbl_deep_extend("force", {}, opts or {})
end,
}, |
Beta Was this translation helpful? Give feedback.
Answered by
mrcjkb
Jan 6, 2024
Replies: 1 comment 1 reply
-
Hey 👋 You've got an error in your config: opts = {
server = function(_, bufnr) should be opts = {
server = {
on_attach = function(_, bufnr) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Blonteractor
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey 👋
You've got an error in your config:
should be