Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Pop a notification prompting the user to add a Cargo.toml of unlinked file to the linkedProjects #14366

Merged
merged 2 commits into from
Mar 28, 2023

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Mar 16, 2023

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 16, 2023
@Veykril Veykril marked this pull request as ready for review March 25, 2023 13:14
@Veykril
Copy link
Member Author

Veykril commented Mar 28, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Mar 28, 2023

📌 Commit 3622fb6 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Mar 28, 2023

⌛ Testing commit 3622fb6 with merge 5bba438...

@bors
Copy link
Contributor

bors commented Mar 28, 2023

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 5bba438 to master...

@bors bors merged commit 5bba438 into rust-lang:master Mar 28, 2023
@Veykril Veykril deleted the linked-proj branch March 28, 2023 08:03
Wilfred added a commit to Wilfred/rust-analyzer that referenced this pull request Jun 6, 2024
Currently, rust-analyzer highlights the entire region when a `cfg` is
inactive (e.g. `#[cfg(windows)]` on a Linux machine). However,
unlinked files only highlight the first three characters of the file.

This was introduced in rust-lang#8444, but users have repeatedly found
themselves with no rust-analyzer support for a file and unsure
why (see e.g. rust-lang#13226 and the intentionally prominent pop-up added in
PR rust-lang#14366).

(Anecdotally, we see this issue bite our users regularly, particularly
people new to Rust.)

Instead, highlight the entire inactive file, but mark it as all as
unused. This allows users to hover and run the quickfix from any line.

Whilst this is marginally more prominent, it's less invasive than a
pop-up, and users do want to know why they're getting no rust-analyzer
support in certain files.
bors added a commit that referenced this pull request Jun 6, 2024
fix: Highlight unlinked files consistently with inactive files

Currently, rust-analyzer highlights the entire region when a `cfg` is inactive (e.g. `#[cfg(windows)]` on a Linux machine). However, unlinked files only highlight the first three characters of the file.

This was introduced in #8444, but users have repeatedly found themselves with no rust-analyzer support for a file and unsure why (see e.g. #13226 and the intentionally prominent pop-up added in PR #14366).

(Anecdotally, we see this issue bite our users regularly, particularly people new to Rust.)

Instead, highlight the entire inactive file, but mark it as all as unused. This allows users to hover and run the quickfix from any line.

Whilst this is marginally more prominent, it's less invasive than a pop-up, and users do want to know why they're getting no rust-analyzer support in certain files.

Before (note the subtle grey underline is only at the beginning of the first line):

![Screenshot 2024-06-05 at 5 41 17 PM](https://github.com/rust-lang/rust-analyzer/assets/70800/96f5d778-612e-4838-876d-35d9647fe2aa)

After (user can hover and fix from any line):

![Screenshot 2024-06-05 at 5 42 13 PM](https://github.com/rust-lang/rust-analyzer/assets/70800/6af90b79-018c-42b9-b3c5-f497de2ccbff)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants