rust-lang / rust-lang/rust-analyzer

Code: consider activating the extension lazily

Open
#7,737 2 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

We currently set workspaceContains:**/Cargo.toml to have the extension activate if Rust code is present in the workspace, but Code will time out after 5 seconds and activate it anyway.

We could try starting only when editing a Rust file, like vscode-rust did in https://github.com/rust-lang/vscode-rust/commit/61838af.

Thanks to @kankri for the awesome investigation in https://github.com/rust-analyzer/rust-analyzer/issues/2533#issuecomment-622930182, which I've unfortunately missed and to @ishowta who dug it up.

Related #2533
Related #7268

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

Start by examining the extension activation configuration that uses workspaceContains:**/Cargo.toml, then compare the lazy activation approach in the referenced vscode-rust commit. Confirm how activation behaves when editing a Rust file and verify that the five-second Code timeout no longer causes premature activation; use related issues #2533 and #7268 for context.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, vscode
Domain
developer-experience, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.