mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Use Source in Diagnostic and implement
This commit is contained in:
parent
d5e8fa606d
commit
475a93097f
2 changed files with 16 additions and 24 deletions
|
@ -48,7 +48,7 @@ pub(crate) fn diagnostics(db: &RootDatabase, file_id: FileId) -> Vec<Diagnostic>
|
|||
})
|
||||
})
|
||||
.on::<hir::diagnostics::UnresolvedModule, _>(|d| {
|
||||
let source_root = db.file_source_root(d.file().original_file(db));
|
||||
let source_root = db.file_source_root(d.source().file_id.original_file(db));
|
||||
let create_file = FileSystemEdit::CreateFile { source_root, path: d.candidate.clone() };
|
||||
let fix = SourceChange::file_system_edit("create module", create_file);
|
||||
res.borrow_mut().push(Diagnostic {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue