rust-lang / rust-lang/rust-analyzer

Meta feature tracking: Language server support for `Cargo.toml` file

Open
#15,741 9 comments 26 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-feature S-needs-toml
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

This issue is an attempt to put all information regarding potential Cargo.toml support in one place.

Blockers

There is no TOML support in RA, and needs a format-preserving parser. toml-edit is maintained along with toml and probably the best choice.

Potential features

  • Autocomplete or schema help (reference: https://doc.rust-lang.org/cargo/reference/manifest.html)
    • Autocomplete keys
    • Suggest valid values for fixed keys like edition, rust-version, license
    • Suggest in-workspace files for license-file, readme, build
    • Autocomplete dependencies (also handled by the crates extension)
    • Autocomplete dependency features
  • Schema validation and warnings/errors, based on the above
  • Quick actions & refactoring
  • Add crates to Cargo.toml from a use statement #10904
  • Lower priority features that are already well-handled with other ecosystem extensions:
    • Link to crates like the crates extension: https://github.com/rust-lang/rust-analyzer/issues/13532
    • Add syntax highlighting to TOML files #3565. I think the syntax highlighting is not much of a concern since Even better TOML does it well, but there are some good general suggestions in the issue

See also the label https://github.com/rust-lang/rust-analyzer/labels/S-needs-toml

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

This is a meta-tracking issue rather than a self-contained task. Start by reading the TOML support blocker, the Cargo manifest reference, and the linked issues for crates integration, then choose a single unchecked feature with a defined scope. Done means that one Cargo.toml language-server capability is implemented and its behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.