mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
⬆️ rustc
This commit is contained in:
parent
de87fe293e
commit
53ae63835d
58 changed files with 640 additions and 610 deletions
|
@ -310,28 +310,30 @@ mod tests {
|
|||
fn test_unresolved_module_diagnostic() {
|
||||
let (analysis, file_id) = single_file("mod foo;");
|
||||
let diagnostics = analysis.diagnostics(file_id).unwrap();
|
||||
assert_debug_snapshot_matches!(diagnostics, @r####"[
|
||||
Diagnostic {
|
||||
message: "unresolved module",
|
||||
range: [0; 8),
|
||||
fix: Some(
|
||||
SourceChange {
|
||||
label: "create module",
|
||||
source_file_edits: [],
|
||||
file_system_edits: [
|
||||
CreateFile {
|
||||
source_root: SourceRootId(
|
||||
0
|
||||
),
|
||||
path: "foo.rs"
|
||||
}
|
||||
],
|
||||
cursor_position: None
|
||||
}
|
||||
),
|
||||
severity: Error
|
||||
}
|
||||
]"####);
|
||||
assert_debug_snapshot_matches!(diagnostics, @r###"
|
||||
⋮[
|
||||
⋮ Diagnostic {
|
||||
⋮ message: "unresolved module",
|
||||
⋮ range: [0; 8),
|
||||
⋮ fix: Some(
|
||||
⋮ SourceChange {
|
||||
⋮ label: "create module",
|
||||
⋮ source_file_edits: [],
|
||||
⋮ file_system_edits: [
|
||||
⋮ CreateFile {
|
||||
⋮ source_root: SourceRootId(
|
||||
⋮ 0,
|
||||
⋮ ),
|
||||
⋮ path: "foo.rs",
|
||||
⋮ },
|
||||
⋮ ],
|
||||
⋮ cursor_position: None,
|
||||
⋮ },
|
||||
⋮ ),
|
||||
⋮ severity: Error,
|
||||
⋮ },
|
||||
⋮]
|
||||
"###);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue