Linting fails when clippy finds an error in a dependency #626
-
Have you read the docs and searched existing issues?
Neovim version (nvim -v)v0.10.2 Operating system/versionNixOS unstable Output of :checkhealth rustaceanvimrustaceanvim: require("rustaceanvim.health").check()
Checking for Lua dependencies ~
- WARNING dap not installed. Needed for debugging features [mfussenegger/nvim-dap](https://github.com/mfussenegger/nvim-dap)
Checking external dependencies ~
- OK rust-analyzer: found rust-analyzer 1.81.0-nightly (6292b2a 2024-07-02)
- OK Cargo: found cargo 1.81.0-nightly (4ed7bee47 2024-06-25)
- OK rustc: found rustc 1.81.0-nightly (6292b2af6 2024-07-02)
- ERROR Failed to run healthcheck for "rustaceanvim" plugin. Exception:
.../data/nvim/lazy/rustaceanvim/lua/rustaceanvim/health.lua:104: cargo-nextest: not found: Could not find an executable binary.
rustaceanvim requires [cargo-nextest](https://nexte.st).
Next generation test runner for Rust projects.
Optional dependency, required if the 'tools.enable_nextest' option is set. My actual config:
How to reproduce the issue
[workspace]
members = [ "mylib","t1"]
[package]
name = "mylib"
version = "0.1.0"
edition = "2021"
[dependencies]
#![deny(unused)]
pub fn add(left: u64, right: u64) -> u64 {
let a = 3;
left + right
}
[package]
name = "t1"
version = "0.1.0"
edition = "2021"
[dependencies]
mylib = { path = "../mylib" }
fn main() {
let a: i32 = "";
println!("Hello, world!");
} Now open I believe it has to do with Expected behaviourIt lints both the unused variable in the dependency AND a type mismatch in the bin project. Actual behaviourIf there's a clippy error in a dependency, the linting stops there. It's worth noting that it works as usual if it is not an error, but, for example, a warning: The minimal config used to reproduce this issue.The one suggested by this form reproduces the issue:
https://github.com/mrcjkb/rustaceanvim/blob/master/troubleshooting/minimal.lua |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hey 👋
This is because rustaceanvim enables clippy by default, if it detects that clippy is installed. If you want to use clippy with rust-analyzer, then I suggest opening an issue there. |
Beta Was this translation helpful? Give feedback.
What do you mean by " enabled RA on top via lspconfig"? RA = rust-analyzer?
rustaceanvim uses rust-analyzer, too. It just doesn't go through nvim-lspconfig. Both rustaceanvim and nvim-lspconfig use
vim.lsp.start
to start the client. And as I said, rustaceanvim doesn't do anything to configure diagnostic settings.If you're absolutely sure you're using the same toolchain with both plugins, I suggest you run
:lua =vim.lsp.get_clients()[1].settings
and:lua =vim.lsp.get_clients()[1].capabilities
and compare between the two plugins.