about summary refs log tree commit diff
path: root/src/tools/rust-analyzer/editors/code
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-06-24 08:11:43 +0000
committerbors <bors@rust-lang.org>2024-06-24 08:11:43 +0000
commitf9a337cc881aba5f4acdc07dffc16a0bb76da99f (patch)
tree59594cfb6c3d5b34e598faf40c61645351b731f2 /src/tools/rust-analyzer/editors/code
parenta32ce24b0c479072dfd125866acca51dd1ba6af3 (diff)
parent39179c49c657adcc7178d5218edc19f725fc0c42 (diff)
downloadrust-f9a337cc881aba5f4acdc07dffc16a0bb76da99f.tar.gz
rust-f9a337cc881aba5f4acdc07dffc16a0bb76da99f.zip
Auto merge of #17411 - Wilfred:clearer_unlinked_file, r=Veykril
fix: Improve hover text in unlinked file diagnostics

Use full sentences, and mention how to disable the diagnostic if users are intentionally working on unowned files.

![Screenshot 2024-06-12 at 5 55 48 PM](https://github.com/rust-lang/rust-analyzer/assets/70800/c91ee1ed-1c72-495a-9ee3-9e360a5c6977)

(Full disclosure: I've tested a rust-analyzer build in VS Code, but the pop-up logic is currently disabled due to #17062, so I haven't tested that.)
Diffstat (limited to 'src/tools/rust-analyzer/editors/code')
-rw-r--r--src/tools/rust-analyzer/editors/code/src/client.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tools/rust-analyzer/editors/code/src/client.ts b/src/tools/rust-analyzer/editors/code/src/client.ts
index 1c2a34b484d..542233e7b91 100644
--- a/src/tools/rust-analyzer/editors/code/src/client.ts
+++ b/src/tools/rust-analyzer/editors/code/src/client.ts
@@ -76,7 +76,8 @@ export async function createClient(
                         // value === "unlinked-file" &&
                         value === "temporary-disabled" &&
                         !unlinkedFiles.includes(uri) &&
-                        diag.message !== "file not included in module tree"
+                        (diag.message === "file not included in crate hierarchy" ||
+                            diag.message.startsWith("This file is not included in any crates"))
                     ) {
                         const config = vscode.workspace.getConfiguration("rust-analyzer");
                         if (config.get("showUnlinkedFileNotification")) {