[Bug]: cargo shuttle run in combination with rust-analyzer causes recompile pingpong
Author: pogopauleCreated Apr 1, 2023Updated Mar 12, 2025
LabelsS-Not Planned
What happened?
First of all, there is already an issue describing the same problem, but it has been closed. For me the problem is still present and the solution described there does not work since I don't use VSCode, but Neovim.
The Problem
- Launch Neovim (with lsp configured for rust-analyzer)
- Open one of the example shuttle projects and let rust-analyzer finish
- Run
cargo shuttle runin another terminal -> triggers a partial rebuild - Go back to Neovim and make a tiny change, e.g. change a string -> triggers a partial rebuild by rust-analyzer
- Goto 3.
If I do a cargo build in step 3 the partial rebuild does not occur. Only a cargo shuttle run does so.
I assume that cargo shuttle run and rust-analyzer launched by neovim somehow partially invalidate each others caches (see Links section below).
I don't understand both tools well enough to debug the issue on my own.
My setup
- NixOS 22.11
- Neovim 0.8.3 with rust-analyzer version 2023-03-27
Links
Here are a few links to resources pointing into a similar direction, but didn't help me:
- https://github.com/rust-lang/rust-analyzer/issues/6136
- https://github.com/rust-lang/rust-analyzer/issues/12714
- https://news.ycombinator.com/item?id=29571792
Version
0.13.0
Which operating systems are you seeing the problem on?
Linux
Which CPU architectures are you seeing the problem on?
x86_64
Relevant log output
No response
Duplicate declaration
- I have searched the issues and there are none like this.
Source: shuttle-hq/shuttle