rust-lang / rust-lang/rust-analyzer

Opening a standalone .rs file after a .txt file makes rust-analyzer unresponsive.

Open
#17,627 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

editor: vscode 1.91.1 with rust-analyzer on Windows

rust-analyzer version: 0.3.2037-standalone (e9afba57a 2024-07-14)

rustc version: 1.79.0 (129f3b996 2024-06-10)

relevant settings: default

To reproduce the problem, you can create a new folder containing a test.txt file including nothing, and a test.rs file including some simple code. Then, open them in order without opening the whole folder in vscode:

code test.txt
code test.rs

Now they are opened in the same vscode window. Wait for a while, and hover over some variables, the information will remain "Loading...". Other functions of rust-analyzer like code completion have no response as well. What's more, CPU usage of rust-analyzer.exe becomes very high. This situation continues until vscode is closed.

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

Reproduce the issue with an empty test.txt and a simple test.rs, opening them in order with code test.txt and code test.rs in VS Code. Observe hover and completion behavior and rust-analyzer.exe CPU usage; done means rust-analyzer remains responsive after opening the standalone Rust file.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.