Open-source project
rust-lang/rust-analyzer avatar
rust-lang/rust-analyzer

rust-analyzer: a Rust front-end that lives in your editor

A Rust compiler front-end for IDEs

16,868 stars2,236 forksRustApache-2.0

At a glance

What is it?
rust-analyzer is the language server behind Rust IDE support in VS Code, Neovim, Emacs and Zed. It ships as a workspace of analysis crates, and installing it is a rustup or editor-extension decision before it is a code decision.
Who is it for?
Adopt rust-analyzer if you write Rust in an LSP-capable editor and want diagnostics, completion and refactorings without a full compiler run on every keystroke. Do not adopt it as a build tool: it does not replace cargo build, cargo test or rustc, and its diagnostics are a separate pipeline from the compiler's.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 7 days ago.
What is it written in?
Mainly Rust, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What rust-analyzer actually replaces

The problem is not that Rust lacks editor support. The problem is that a compiler front-end is the wrong shape for an editor. rustc is built to consume a crate and emit artifacts; an editor needs to answer questions about a half-written file, in milliseconds, while the user is still typing. rust-analyzer exists to answer those questions, and the README states its scope plainly: it is a language server providing IDE functionality for writing Rust programs, usable with any editor that supports the Language Server Protocol, naming VS Code, Vim, Emacs and Zed.

The audience is therefore anyone writing Rust in an LSP-capable editor, plus the people building tooling on top of its analysis crates. The README says the project is internally structured as a set of libraries for analyzing Rust code, and points contributors at an Architecture page in the manual. That second audience matters: the crates directory in the repository is not an implementation detail to be hidden, it is the product surface for anyone embedding Rust analysis in something else.

What it is not is a compiler. The README describes integrated diagnostics with rustc and clippy, which is a description of coordination, not of replacement. If you are looking for a build tool, this is the wrong repository.

The crate split behind the language server

The workspace layout in Cargo.toml is the clearest statement of how the project is organised. Members are xtask, lib/*, lib/ungrammar/ungrammar2json and crates/*, with a resolver of 2. The workspace package declares rust-version 1.98 and edition 2024, so building from source pins you to a recent toolchain. There is no pretending otherwise: this is a codebase tracking the language closely.

Inside crates/*, the dependency list in the workspace table shows the layering. base-db, cfg, hir, hir-def, hir-expand and hir-ty form the analysis stack, with hir-ty sitting at the top of it. Above that sit the IDE-facing crates: ide, ide-assists, ide-completion, ide-db and ide-diagnostics. The naming is unusually honest about the boundary. hir-ty computes types; ide-completion turns types into completion items. A change in the lower layer propagates upward, which is why the crate list reads like a stack rather than a bag of modules.

The profile section is worth reading for a different reason. Under profile.dev.package, rowan, rustc-hash, smol_str, text-size, serde, salsa and dissimilar are all given opt-level 3, with a comment that these speed up local tests. That is an admission that the default dev profile is not fast enough for this workload, and the project compensates per dependency rather than globally. If you build the workspace yourself, expect the first build to be slow and the test loop to depend on those overrides.

One more detail from the manifest: the patch section for crates-io contains only commented-out lines for rowan, line-index, la-arena, lsp-server, ungrammar and salsa. It is a maintained list of the dependencies a contributor might want to swap for a local checkout, kept inert by default.

Installing rust-analyzer and opening a first file

The README does not carry install instructions itself. It has a Quick Start section whose entire content is a link to the installation page of the manual, so the manual is the authoritative source. Two routes exist: a prebuilt binary distributed through your toolchain or editor extension, and a build from source.

For the toolchain route, rustup can carry the component. The exact component name and availability depend on your channel, and the community error message about an unknown rust-analyzer binary in the official toolchain is what you see when the component is not present on that channel.

The repository also ships an xtask crate, and the Cargo.toml comment references cargo xtask dist as a build path. The manifest notes that miniz_oxide is given opt-level 3 specifically to speed that command up.

bash
cargo xtask dist

Running it produces a distribution build of the server. Once you have a binary, the editor side is a client configuration problem, not a rust-analyzer problem. In VS Code the extension launches the server for you. In Neovim, Emacs or Zed you configure an LSP client to start the rust-analyzer binary for Rust filetypes. The README's own framing is that any LSP-capable editor works, which means the setup instructions you need are your editor's, and the manual is where the Rust-specific tips live.

Where rust-analyzer stops and rustc begins

The most common wrong expectation is that rust-analyzer's diagnostics are the compiler's diagnostics. They are not. The README describes integrated diagnostics with rustc and clippy, which tells you the project coordinates with those tools rather than reimplementing them. The analysis crates compute types and resolve names from source, and rustc computes them from the same source with a different set of rules and a different tolerance for incomplete code.

This produces a class of confusing reports. Code that rust-analyzer accepts can fail cargo build, and code that rust-analyzer flags can compile cleanly. Neither is a bug in the ordinary sense; they are two front-ends with different jobs. If your workflow treats the editor squiggle as the build gate, you will be surprised eventually, and the surprise will not be reproducible in CI.

The second boundary is workspace loading. The related searches around a failed workspace fetch point at a real operational class: the server needs to load a cargo workspace to know about your crates, and when that load fails, the symptoms look like the server is broken rather than like the workspace is unusual. The README does not document rollback or recovery behaviour for that case, and the manual's troubleshooting material is where the project routes such requests, alongside the Rust forum's IDEs and Editors category.

A third limitation is the shape of the project itself. rust-version 1.98 and edition 2024 in the workspace manifest mean building from source is not a casual act on an older toolchain. If you are pinned to an older compiler for a work project, the prebuilt route is the practical one, and the source route is the one that will fight you.

How it differs from a compiler-driven editor plugin

The obvious alternative is an editor integration that shells out to cargo and rustc for everything: run cargo check on save, parse the output, jump to the reported locations. That approach has one real advantage, which is that its diagnostics are the compiler's diagnostics, so there is no second opinion to reconcile. Its cost is latency and completeness. cargo check needs a resolvable workspace and a build; go-to-definition for a symbol in a file you have not saved yet is not something it can answer.

rust-analyzer inverts the trade. It maintains its own analysis over the source as it stands, which is what makes completion, find-all-references and refactorings possible at typing speed. The price is the reconciliation problem described above, and a dependency on the workspace loading cleanly.

There is a third option worth naming because it is often confused with the second: using rustc directly through its own JSON diagnostics. That gives you compiler-accurate errors but no completion, no assists, and no reference search. It is a diagnostics channel, not an IDE.

The README's own list of features, go-to-definition, find-all-references, refactorings and code completion, is exactly the set that a cargo-check-on-save plugin cannot provide well. That is the honest dividing line between the two approaches.

Maintenance, releases and what the licence lets you do

The repository is not archived, and the last push was on 2026-09-21. Releases are frequent: the listed releases include dated builds on 2026-09-21 and 2026-09-14, plus a nightly channel dated 2026-09-21. That cadence is the practical upgrade story. There is no long-term support line in the README, so the choice is between dated releases and nightly, and the nightly channel is the one that moves fastest.

Upgrade cost is mostly on the distribution side. If you take the binary from your editor extension, the extension manages it. If you take it from your toolchain, rustup manages it. If you build from source, you inherit the workspace's rust-version 1.98 floor and the edition 2024 setting, and you should expect to rebuild when you move toolchains. The manifest's dev-profile overrides exist precisely because that rebuild is not cheap.

On licensing, the README states that rust-analyzer is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), pointing at LICENSE-MIT and LICENSE-APACHE. The workspace manifest agrees, declaring license = "MIT OR Apache-2.0". That dual arrangement is the standard Rust ecosystem pattern and is permissive, but whether it fits a given redistribution or vendoring plan is a question for your own legal review, not something this article can settle. Note the word primarily in the README: it is a hedge, and the two LICENSE files are the ones that govern.

Editorial conclusion

Adopt rust-analyzer if you write Rust in an LSP-capable editor and want diagnostics, completion and refactorings without a full compiler run on every keystroke. Do not adopt it as a build tool: it does not replace cargo build, cargo test or rustc, and its diagnostics are a separate pipeline from the compiler's. Before relying on it, verify that your editor's client is the one the manual documents, and check whether your toolchain already bundles the binary, since the official toolchain error about an unknown rust-analyzer binary is a common first obstacle.

Frequently asked questions

How do I install rust-analyzer?

The README's Quick Start points to the installation page of the manual rather than listing steps. In practice you either take a prebuilt binary through your toolchain or editor extension, or build from source with the repository's xtask crate.

How do I install rust-analyzer with rustup?

The README does not list component commands; it points to the installation page of the manual, and the community error about an unknown rust-analyzer binary in the official toolchain is what appears when the component is absent from your channel.

How do I set up rust-analyzer in VS Code?

You do not configure the server manually in VS Code. The editor extension launches it, and the README's statement that rust-analyzer works with any LSP-capable editor is the reason the Rust-specific setup instructions live in the manual rather than in the repository README.

How do I set up rust-analyzer in Neovim?

Neovim is one of the editors the README names as supported. Setup means configuring your LSP client to start the rust-analyzer binary for Rust filetypes; the README does not document client configuration, and the manual is where the project routes usage questions.

What settings does rust-analyzer expose?

The repository does not document a settings reference in its README. The README routes usage and troubleshooting requests to the IDEs and Editors category of the Rust forum, and points to the manual for tips, so configuration keys should be read from the manual rather than inferred.

Why is rust-analyzer not working in my editor?

Two causes are visible: the binary may not be present on your toolchain channel, which produces the unknown-binary error, or the server may have failed to load your cargo workspace. The README does not document recovery behaviour for a failed workspace load, and directs troubleshooting to the Rust forum's IDEs and Editors category.

Official sources

  1. License: Apache-2.0
  2. Project website
  3. README
  4. Releases
  5. rust-lang/rust-analyzer on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/rust-lang-rust-analyzer.svg)](https://hysenlabs.com/projects/rust-lang-rust-analyzer)