about summary refs log tree commit diff
path: root/tests/ui/patchable-function-entry/patchable-function-entry-attribute.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-06-06 07:49:58 +0000
committerbors <bors@rust-lang.org>2024-06-06 07:49:58 +0000
commitb8e94ddb7d55ab1f41645498c09642417b4b02b6 (patch)
treeee57ff94eb655262ca2ff851d05abf1d52226221 /tests/ui/patchable-function-entry/patchable-function-entry-attribute.rs
parent3a99bb063ab70ac007cd6471c1e89b6f0e4f58f2 (diff)
parent901c01c2796d4056266fd3479806b0d408f8a602 (diff)
downloadrust-b8e94ddb7d55ab1f41645498c09642417b4b02b6.tar.gz
rust-b8e94ddb7d55ab1f41645498c09642417b4b02b6.zip
Auto merge of #17350 - Wilfred:mark_missing_file_unused, r=Veykril
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)
Diffstat (limited to 'tests/ui/patchable-function-entry/patchable-function-entry-attribute.rs')
0 files changed, 0 insertions, 0 deletions