rust-lang / rust-lang/rust-analyzer

"Open Cargo.toml" does not do anything in specific scenario

Open
#9,877 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-ide C-feature E-medium S-actionable
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

With a specific sequence of steps the "Open Cargo.toml" command of Rust Analyzer can be made to fail:

  • Open any Rust project (directory) with a suitable top-level Cargo.toml file
  • Close all open text editors
  • In vscode Explorer sidebar, single click on the Cargo.toml
    //vscode opens Cargo.toml in a new text editor
  • Click on the (x) on the editor tab to close the editor window
    //editor window closes
    // Cargo.toml still highlighted in blue in Explorer Sidebar
  • Ctrl+Shift+P for vscode command palette
  • "Rust Analyzer: Open Cargo.toml"
    //exp: opens Cargo.toml in editor
    //act: nothing happens

Now, I'd actually suggest that removing the command "Rust Analyzer: Open Cargo.toml" at large is the best way to address this: The ever so handy "Go to file ..." command has auto-completion, so all it takes to get to Cargo.toml is "g f cargo" (or even less depending on completion magic)

Unless "Rust Analyzer: Open Cargo.toml" does more than just "Go to file ... Cargo.toml", I'd propose that it's added value might not be all that great?

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

The issue names no source file, test, or entry point. Reproduce the documented VS Code sequence, then locate the Rust Analyzer: Open Cargo.toml command and decide whether its behavior should be fixed or the command removed; done means the command reliably opens Cargo.toml or no longer appears.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.