diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2022-04-04 15:54:29 +0200 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2022-04-04 16:04:09 +0200 |
| commit | 3a847eacc82e2413b9051e315250f5ce668d7bb9 (patch) | |
| tree | e4aea9cf77594acd941b5c42515a6296f1c20510 | |
| parent | 46d7ee68f26285db26b2640f2c07d6332380c756 (diff) | |
| download | rust-3a847eacc82e2413b9051e315250f5ce668d7bb9.tar.gz rust-3a847eacc82e2413b9051e315250f5ce668d7bb9.zip | |
fix: Show the path to be created in the unresolved-module fix label
| -rw-r--r-- | crates/ide_diagnostics/src/handlers/unresolved_module.rs | 6 | ||||
| -rw-r--r-- | crates/rust-analyzer/tests/slow-tests/main.rs | 8 |
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": [ |
