diff options
Diffstat (limited to 'crates/ra_ide_api/src/lib.rs')
-rw-r--r-- | crates/ra_ide_api/src/lib.rs | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs index f5c1aa036..312b11a82 100644 --- a/crates/ra_ide_api/src/lib.rs +++ b/crates/ra_ide_api/src/lib.rs | |||
@@ -14,7 +14,6 @@ | |||
14 | #![recursion_limit = "128"] | 14 | #![recursion_limit = "128"] |
15 | 15 | ||
16 | mod db; | 16 | mod db; |
17 | mod imp; | ||
18 | pub mod mock_analysis; | 17 | pub mod mock_analysis; |
19 | mod symbol_index; | 18 | mod symbol_index; |
20 | mod navigation_target; | 19 | mod navigation_target; |
@@ -32,6 +31,7 @@ mod parent_module; | |||
32 | mod references; | 31 | mod references; |
33 | mod impls; | 32 | mod impls; |
34 | mod assists; | 33 | mod assists; |
34 | mod diagnostics; | ||
35 | 35 | ||
36 | #[cfg(test)] | 36 | #[cfg(test)] |
37 | mod marks; | 37 | mod marks; |
@@ -58,7 +58,7 @@ pub use crate::{ | |||
58 | change::{AnalysisChange, LibraryData}, | 58 | change::{AnalysisChange, LibraryData}, |
59 | }; | 59 | }; |
60 | pub use ra_ide_api_light::{ | 60 | pub use ra_ide_api_light::{ |
61 | Fold, FoldKind, HighlightedRange, Severity, StructureNode, | 61 | Fold, FoldKind, HighlightedRange, Severity, StructureNode, LocalEdit, |
62 | LineIndex, LineCol, translate_offset_with_edit, | 62 | LineIndex, LineCol, translate_offset_with_edit, |
63 | }; | 63 | }; |
64 | pub use ra_db::{ | 64 | pub use ra_db::{ |
@@ -399,6 +399,23 @@ impl Analysis { | |||
399 | } | 399 | } |
400 | } | 400 | } |
401 | 401 | ||
402 | impl SourceChange { | ||
403 | pub(crate) fn from_local_edit(file_id: FileId, edit: LocalEdit) -> SourceChange { | ||
404 | let file_edit = SourceFileEdit { | ||
405 | file_id, | ||
406 | edit: edit.edit, | ||
407 | }; | ||
408 | SourceChange { | ||
409 | label: edit.label, | ||
410 | source_file_edits: vec![file_edit], | ||
411 | file_system_edits: vec![], | ||
412 | cursor_position: edit | ||
413 | .cursor_position | ||
414 | .map(|offset| FilePosition { offset, file_id }), | ||
415 | } | ||
416 | } | ||
417 | } | ||
418 | |||
402 | #[test] | 419 | #[test] |
403 | fn analysis_is_send() { | 420 | fn analysis_is_send() { |
404 | fn is_send<T: Send>() {} | 421 | fn is_send<T: Send>() {} |