aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/lib.rs')
-rw-r--r--crates/ra_ide_api/src/lib.rs21
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
16mod db; 16mod db;
17mod imp;
18pub mod mock_analysis; 17pub mod mock_analysis;
19mod symbol_index; 18mod symbol_index;
20mod navigation_target; 19mod navigation_target;
@@ -32,6 +31,7 @@ mod parent_module;
32mod references; 31mod references;
33mod impls; 32mod impls;
34mod assists; 33mod assists;
34mod diagnostics;
35 35
36#[cfg(test)] 36#[cfg(test)]
37mod marks; 37mod marks;
@@ -58,7 +58,7 @@ pub use crate::{
58 change::{AnalysisChange, LibraryData}, 58 change::{AnalysisChange, LibraryData},
59}; 59};
60pub use ra_ide_api_light::{ 60pub 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};
64pub use ra_db::{ 64pub use ra_db::{
@@ -399,6 +399,23 @@ impl Analysis {
399 } 399 }
400} 400}
401 401
402impl 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]
403fn analysis_is_send() { 420fn analysis_is_send() {
404 fn is_send<T: Send>() {} 421 fn is_send<T: Send>() {}