move diagnostics to a separate file
This commit is contained in:
parent
e4a6343e47
commit
8328e196dd
@ -1,13 +1,8 @@
|
||||
use hir::{
|
||||
self, Problem, source_binder
|
||||
};
|
||||
use ra_ide_api_light::{self, LocalEdit, Severity};
|
||||
use hir::{Problem, source_binder};
|
||||
use ra_ide_api_light::Severity;
|
||||
use ra_db::SourceDatabase;
|
||||
|
||||
use crate::{
|
||||
db, Diagnostic, FileId, FilePosition, FileSystemEdit,
|
||||
SourceChange, SourceFileEdit,
|
||||
};
|
||||
use crate::{db, Diagnostic, FileId, FileSystemEdit, SourceChange};
|
||||
|
||||
impl db::RootDatabase {
|
||||
pub(crate) fn diagnostics(&self, file_id: FileId) -> Vec<Diagnostic> {
|
||||
@ -74,20 +69,3 @@ impl db::RootDatabase {
|
||||
res
|
||||
}
|
||||
}
|
||||
|
||||
impl SourceChange {
|
||||
pub(crate) fn from_local_edit(file_id: FileId, edit: LocalEdit) -> SourceChange {
|
||||
let file_edit = SourceFileEdit {
|
||||
file_id,
|
||||
edit: edit.edit,
|
||||
};
|
||||
SourceChange {
|
||||
label: edit.label,
|
||||
source_file_edits: vec![file_edit],
|
||||
file_system_edits: vec![],
|
||||
cursor_position: edit
|
||||
.cursor_position
|
||||
.map(|offset| FilePosition { offset, file_id }),
|
||||
}
|
||||
}
|
||||
}
|
@ -14,7 +14,6 @@
|
||||
#![recursion_limit = "128"]
|
||||
|
||||
mod db;
|
||||
mod imp;
|
||||
pub mod mock_analysis;
|
||||
mod symbol_index;
|
||||
mod navigation_target;
|
||||
@ -32,6 +31,7 @@ mod parent_module;
|
||||
mod references;
|
||||
mod impls;
|
||||
mod assists;
|
||||
mod diagnostics;
|
||||
|
||||
#[cfg(test)]
|
||||
mod marks;
|
||||
@ -58,7 +58,7 @@ pub use crate::{
|
||||
change::{AnalysisChange, LibraryData},
|
||||
};
|
||||
pub use ra_ide_api_light::{
|
||||
Fold, FoldKind, HighlightedRange, Severity, StructureNode,
|
||||
Fold, FoldKind, HighlightedRange, Severity, StructureNode, LocalEdit,
|
||||
LineIndex, LineCol, translate_offset_with_edit,
|
||||
};
|
||||
pub use ra_db::{
|
||||
@ -399,6 +399,23 @@ impl Analysis {
|
||||
}
|
||||
}
|
||||
|
||||
impl SourceChange {
|
||||
pub(crate) fn from_local_edit(file_id: FileId, edit: LocalEdit) -> SourceChange {
|
||||
let file_edit = SourceFileEdit {
|
||||
file_id,
|
||||
edit: edit.edit,
|
||||
};
|
||||
SourceChange {
|
||||
label: edit.label,
|
||||
source_file_edits: vec![file_edit],
|
||||
file_system_edits: vec![],
|
||||
cursor_position: edit
|
||||
.cursor_position
|
||||
.map(|offset| FilePosition { offset, file_id }),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn analysis_is_send() {
|
||||
fn is_send<T: Send>() {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user