fix: Show the path to be created in the unresolved-module fix label

This commit is contained in:
Lukas Wirth 2022-04-04 15:54:29 +02:00
parent 46d7ee68f2
commit 3a847eacc8
2 changed files with 7 additions and 7 deletions

View File

@ -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 @@ fn test_unresolved_module_diagnostic() {
"create_module",
QuickFix,
),
label: "Create module",
label: "Create module at `foo.rs`",
group: None,
target: 0..8,
source_change: Some(
@ -123,7 +123,7 @@ fn test_unresolved_module_diagnostic() {
"create_module",
QuickFix,
),
label: "Create module",
label: "Create module at `foo/mod.rs`",
group: None,
target: 0..8,
source_change: Some(

View File

@ -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": [