You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of rust-lang#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.

(Full disclosure: I've tested a rust-analyzer build in VS Code, but the pop-up logic is currently disabled due to rust-lang#17062, so I haven't tested that.)
Copy file name to clipboardExpand all lines: src/tools/rust-analyzer/crates/ide-diagnostics/src/handlers/unlinked_file.rs
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -30,11 +30,13 @@ pub(crate) fn unlinked_file(
30
30
// FIXME: This is a hack for the vscode extension to notice whether there is an autofix or not before having to resolve diagnostics.
31
31
// This is to prevent project linking popups from appearing when there is an autofix. https://github.com/rust-lang/rust-analyzer/issues/14523
32
32
let message = if fixes.is_none(){
33
-
"file not included in crate hierarchy"
33
+
"This file is not included in any crates, so rust-analyzer can't offer IDE services."
34
34
}else{
35
-
"file not included in module tree"
35
+
"This file is not included anywhere in the module tree, so rust-analyzer can't offer IDE services."
36
36
};
37
37
38
+
let message = format!("{message}\n\nIf you're intentionally working on unowned files, you can silence this warning by adding \"unlinked-file\" to rust-analyzer.diagnostics.disabled in your settings.");
39
+
38
40
letmut range = ctx.sema.db.parse(file_id).syntax_node().text_range();
0 commit comments