Skip to content

toolchain: install matching rust-analyzer - #1956

Open
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 1 commit into
masterfrom
chore/pin-rust-analyzer
Open

toolchain: install matching rust-analyzer#1956
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 1 commit into
masterfrom
chore/pin-rust-analyzer

Conversation

@irvingoujAtDevolution

Copy link
Copy Markdown
Contributor

Keep rust-analyzer aligned with each repository toolchain

The current rust-analyzer extension bundles a server that requires Rust 1.94 or newer. This minimum was raised from 1.78 to 1.94, and the released code sets it to 1.94 at MINIMUM_SUPPORTED_TOOLCHAIN_VERSION.

These repositories intentionally pin older toolchains:

Repository Rust toolchain
Gateway 1.90.0
picky-rs 1.88.0

Opening either repository now triggers an incompatible-toolchain warning. This adds the official rust-analyzer component next to rustfmt and clippy:

components = ["rustfmt", "clippy", "rust-analyzer"]

The VS Code extension has an explicit toolchain-server selection path. It calls rustup which rust-analyzer only when rust-analyzer is declared in the repository toolchain file. Otherwise, it falls back to its newer bundled server.

Why not install rust-analyzer locally?

Installing it is not enough. I already had the Rust 1.90 component installed for Gateway, but the extension did not select it because the repository did not declare it. The alternative is a machine-specific rust-analyzer.server.path, which every developer and editor would need to maintain separately.

Why not downgrade the extension?

The extension version is global, but these Rust versions are repository-specific. Downgrading it for these repositories would also downgrade it for newer Rust workspaces. The extension also updates automatically, so this workaround requires disabling updates or repeatedly downgrading it.

Why not upgrade the Rust toolchains?

That changes the compiler used by each repository and is much broader than fixing editor compatibility. Using the matching analyzer component preserves the existing compiler pins.

Why should an editor tool be declared by the repository?

These toolchain files already declare the repository's development tools through rustfmt and clippy. rust-analyzer is also an official Rust component. Declaring it keeps the compiler/analyzer pairing in the same place instead of duplicating it in local editor settings.

What is the tradeoff?

Rustup installs one additional development component in environments that honor the toolchain file. In return, contributors get a compatible analyzer automatically, without global extension downgrades or per-machine server configuration.


LLM Wrote, Irving Audited.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Let maintainers know that an action is required on their side

  • Add the label release-required Please cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module) when you request a maintainer to cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module)

  • Add the label release-blocker Follow-up is required before cutting a new release if a follow-up is required before cutting a new release

  • Add the label publish-required Please publish libraries (`Devolutions.Gateway.Utils`, OpenAPI clients, etc) when you request a maintainer to publish libraries (Devolutions.Gateway.Utils, OpenAPI clients, etc.)

  • Add the label publish-blocker Follow-up is required before publishing libraries if a follow-up is required before publishing libraries

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the toolchain-matched rust-analyzer component for editor compatibility.

Changes:

  • Declares rust-analyzer alongside rustfmt and clippy.
  • PR title should be chore(toolchain): install matching rust-analyzer.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants