-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rust-analyzer to rust-toolchain.toml #12618
base: master
Are you sure you want to change the base?
Conversation
Without this, people who rely on the rust-analyzer version provided by rustup have to install it manually to work on helix.
I would prefer to mention installing rust-analyzer in the contributing docs. Putting this in rust-toolchain.toml means that rust-analyzer is stuck at an older version following our MSRV but the latest rust-analyzer should work |
This goes for all the other tooling as well tough, right? For example, pinning clippy to 1.76 prevents the incompatible_msrv lint. I've seen a couple projects use But I didn't search for existing discussions around this, there may be other reasons for keeping the |
Clippy is pinned because if it follows latest stable then CI will fail whenever a new stable Rust is published, same with rustfmt |
But aren't clippy and rustfmt already pinned to MSRV in CI? Independent of lints:
name: Lints
runs-on: ubuntu-latest
if: github.repository == 'helix-editor/helix' || github.event_name != 'schedule'
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install MSRV toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.MSRV }} # <-- here |
Hmm yeah we could remove the rust-toolchain.toml then and check MSRV in CI and rely on Clippy locally. I did some testing though and let s: Arc<str> = Default::default();
// or even
let s: Arc<str> = Arc::default();
let s = Arc::<str>::default() ( I'm open to dropping the |
Hmm, yeah that makes sense. I should also note that the clippy lint doesn't check dependencies at all, even if it was robust. I ran into this once where I updated a depenceny which violated its declared MSRV and that was only caught in CI. |
I can add some documentation as you suggested, but what would you suggest people actually do? Running |
We can advise installing rust-analyzer through a system package manager or rustup if that's not an option, giving the caveat that the version might be older |
Is that a setup that's known to work for many people? I think this would fail on most setups. Rustup modifies the PATH by prefixing |
For anyone already using rustup we could recommend adding the component if it wouldn't work to install it trhough the system package manager. With the Nix development shell we use the rust-analyzer from nixpkgs while rustc, clippy, rustfmt etc. are pinned to the rust-toolchain.toml version Lines 171 to 174 in 7c907e6
|
Without this, people who rely on the rust-analyzer version provided by rustup have to install it manually to work on helix.