mrcjkb / rustaceanvim

Supercharge your Rust experience in Neovim! A heavily modified fork of rust-tools.nvim
GNU General Public License v2.0
1.29k stars 47 forks source link

configure neotest adapter to pass test args #445

Open bushuyev opened 1 week ago

bushuyev commented 1 week ago

Feature description

more of a question than a feature request, is it possible to pass --show-output/--no-capture to cargo/nextest somehow like in https://github.com/rouge8/neotest-rust or get tests output in an other way?

mrcjkb commented 1 week ago

Hey 👋

That's currently not supported in the neotest adapter configuration, but it could be implemented. I would probably make it part of the vim.g.rustaceanvim config to support .exrc.

For now, it is possible to pass args to the RustLsp runnables command, which will default to using neotest if it's configured.

bushuyev commented 1 week ago

tried


        vim.keymap.set("n", "<leader>mT", function()
          vim.cmd.RustLsp("runnables", "--no-capture")
        end, { desc = "My Rust Runnables", buffer = bufnr })

and got

failed to parse test binary arguments --no-capture: arguments are unsupported

but anyway, running it from console should be good enough for now :)

Thank you for quick reply!

mrcjkb commented 1 week ago

I'll reopen this, as configuring the neotest adapter with args could be useful.

failed to parse test binary arguments --no-capture: arguments are unsupported

You probably need cargo-nextest for that. Edit: Oh wait IIRC the RustLsp runnables {args} are passed to the executable, not the test runner.