about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-04-04 14:14:26 +0000
committerGitHub <noreply@github.com>2022-04-04 14:14:26 +0000
commitbf6303df3721119090dfb50340f6cccc71d5ccc8 (patch)
treef13c3cb5b80057090d0352bdd4acabca21df03af
parentf5c069c9d909dc13ca84415e228288a08b95df7d (diff)
parent3a847eacc82e2413b9051e315250f5ce668d7bb9 (diff)
downloadrust-bf6303df3721119090dfb50340f6cccc71d5ccc8.tar.gz
rust-bf6303df3721119090dfb50340f6cccc71d5ccc8.zip
Merge #11896
11896: fix: Show the path to be created in the unresolved-module fix label r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
-rw-r--r--crates/ide_diagnostics/src/handlers/unresolved_module.rs6
-rw-r--r--crates/rust-analyzer/tests/slow-tests/main.rs8
2 files changed, 7 insertions, 7 deletions
diff --git a/crates/ide_diagnostics/src/handlers/unresolved_module.rs b/crates/ide_diagnostics/src/handlers/unresolved_module.rs
index 640ba38a282..587a3ee26de 100644
--- a/crates/ide_diagnostics/src/handlers/unresolved_module.rs
+++ b/crates/ide_diagnostics/src/handlers/unresolved_module.rs
@@ -39,7 +39,7 @@ fn fixes(ctx: &DiagnosticsContext<'_>, d: &hir::UnresolvedModule) -> Option<Vec<
             .map(|candidate| {
                 fix(
                     "create_module",
-                    "Create module",
+                    &format!("Create module at `{candidate}`"),
                     FileSystemEdit::CreateFile {
                         dst: AnchoredPathBuf {
                             anchor: d.decl.file_id.original_file(ctx.sema.db),
@@ -97,7 +97,7 @@ mod baz {}
                                         "create_module",
                                         QuickFix,
                                     ),
-                                    label: "Create module",
+                                    label: "Create module at `foo.rs`",
                                     group: None,
                                     target: 0..8,
                                     source_change: Some(
@@ -123,7 +123,7 @@ mod baz {}
                                         "create_module",
                                         QuickFix,
                                     ),
-                                    label: "Create module",
+                                    label: "Create module at `foo/mod.rs`",
                                     group: None,
                                     target: 0..8,
                                     source_change: Some(
diff --git a/crates/rust-analyzer/tests/slow-tests/main.rs b/crates/rust-analyzer/tests/slow-tests/main.rs
index eb7e73236ab..147e8c141a2 100644
--- a/crates/rust-analyzer/tests/slow-tests/main.rs
+++ b/crates/rust-analyzer/tests/slow-tests/main.rs
@@ -465,7 +465,7 @@ fn main() {}
         },
         json!([
             {
-                "title": "Create module",
+                "title": "Create module at `bar.rs`",
                 "kind": "quickfix",
                 "edit": {
                 "documentChanges": [
@@ -477,7 +477,7 @@ fn main() {}
                 }
             },
             {
-                "title": "Create module",
+                "title": "Create module at `bar/mod.rs`",
                 "kind": "quickfix",
                 "edit": {
                 "documentChanges": [
@@ -549,7 +549,7 @@ fn main() {{}}
         },
         json!([
             {
-                "title": "Create module",
+                "title": "Create module at `bar.rs`",
                 "kind": "quickfix",
                 "edit": {
                 "documentChanges": [
@@ -561,7 +561,7 @@ fn main() {{}}
                 }
             },
             {
-                "title": "Create module",
+                "title": "Create module at `bar/mod.rs`",
                 "kind": "quickfix",
                 "edit": {
                 "documentChanges": [