folke / neoconf.nvim

💼 Neovim plugin to manage global and project-local settings
Apache License 2.0
715 stars 29 forks source link

bug: neoconf changes the invocation location of `cargo check` when using rust-analyzer in a cargo workspace #10

Closed calops closed 1 year ago

calops commented 1 year ago

Did you check docs and existing issues?

Neovim version (nvim -v)

v0.9.0-dev-845+gfacbb11e0

Operating system/version

Linux 6

Describe the bug

When opening a crate within a cargo workspace, if a .neoconf.json file is present at the root of the project, cargo check (which is usually executed on save, to produce diagnostics) is instead executed at the root of the whole workspace. This either does not work at all (you don't need to have a Cargo.toml present at the root of a workspace), or launches the check on the entire workspace, which can be prohibitively slow and expensive.

A workaround: create a .neoconf.json file at the root of the crate, and it'll be used instead of the workspace-level one. Drawback: you need to duplicate the settings in every single crate that way. At least symlinks work.

As a side-note, it would be awesome to be able to "stack" config files within a project, where a folder could override the settings present in a parent folder, up to the root of the git repository (if one exists). This would be particularly useful for rust workspaces, for example when specifying feature flags specific to some crates.

Steps To Reproduce

This can be reproduced on any rust repository that contains several crates, for example nvim-oxi and checking the LSP logs.

Expected Behavior

I expect cargo check to be run from the current working directory, as is the default behavior when no .neoconf.json file is present.

Repro

No response