diff options
Diffstat (limited to 'crates/ra_ide_db/src/source_change.rs')
-rw-r--r-- | crates/ra_ide_db/src/source_change.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/crates/ra_ide_db/src/source_change.rs b/crates/ra_ide_db/src/source_change.rs index af81a91a4..94e118dd8 100644 --- a/crates/ra_ide_db/src/source_change.rs +++ b/crates/ra_ide_db/src/source_change.rs | |||
@@ -4,7 +4,7 @@ | |||
4 | //! It can be viewed as a dual for `AnalysisChange`. | 4 | //! It can be viewed as a dual for `AnalysisChange`. |
5 | 5 | ||
6 | use ra_db::{FileId, FilePosition, RelativePathBuf, SourceRootId}; | 6 | use ra_db::{FileId, FilePosition, RelativePathBuf, SourceRootId}; |
7 | use ra_text_edit::{TextEdit, TextSize}; | 7 | use ra_text_edit::TextEdit; |
8 | 8 | ||
9 | #[derive(Debug, Clone)] | 9 | #[derive(Debug, Clone)] |
10 | pub struct SourceChange { | 10 | pub struct SourceChange { |
@@ -13,6 +13,7 @@ pub struct SourceChange { | |||
13 | pub source_file_edits: Vec<SourceFileEdit>, | 13 | pub source_file_edits: Vec<SourceFileEdit>, |
14 | pub file_system_edits: Vec<FileSystemEdit>, | 14 | pub file_system_edits: Vec<FileSystemEdit>, |
15 | pub cursor_position: Option<FilePosition>, | 15 | pub cursor_position: Option<FilePosition>, |
16 | pub is_snippet: bool, | ||
16 | } | 17 | } |
17 | 18 | ||
18 | impl SourceChange { | 19 | impl SourceChange { |
@@ -28,6 +29,7 @@ impl SourceChange { | |||
28 | source_file_edits, | 29 | source_file_edits, |
29 | file_system_edits, | 30 | file_system_edits, |
30 | cursor_position: None, | 31 | cursor_position: None, |
32 | is_snippet: false, | ||
31 | } | 33 | } |
32 | } | 34 | } |
33 | 35 | ||
@@ -41,6 +43,7 @@ impl SourceChange { | |||
41 | source_file_edits: edits, | 43 | source_file_edits: edits, |
42 | file_system_edits: vec![], | 44 | file_system_edits: vec![], |
43 | cursor_position: None, | 45 | cursor_position: None, |
46 | is_snippet: false, | ||
44 | } | 47 | } |
45 | } | 48 | } |
46 | 49 | ||
@@ -52,6 +55,7 @@ impl SourceChange { | |||
52 | source_file_edits: vec![], | 55 | source_file_edits: vec![], |
53 | file_system_edits: edits, | 56 | file_system_edits: edits, |
54 | cursor_position: None, | 57 | cursor_position: None, |
58 | is_snippet: false, | ||
55 | } | 59 | } |
56 | } | 60 | } |
57 | 61 | ||
@@ -105,7 +109,6 @@ pub enum FileSystemEdit { | |||
105 | pub struct SingleFileChange { | 109 | pub struct SingleFileChange { |
106 | pub label: String, | 110 | pub label: String, |
107 | pub edit: TextEdit, | 111 | pub edit: TextEdit, |
108 | pub cursor_position: Option<TextSize>, | ||
109 | } | 112 | } |
110 | 113 | ||
111 | impl SingleFileChange { | 114 | impl SingleFileChange { |
@@ -114,7 +117,8 @@ impl SingleFileChange { | |||
114 | label: self.label, | 117 | label: self.label, |
115 | source_file_edits: vec![SourceFileEdit { file_id, edit: self.edit }], | 118 | source_file_edits: vec![SourceFileEdit { file_id, edit: self.edit }], |
116 | file_system_edits: Vec::new(), | 119 | file_system_edits: Vec::new(), |
117 | cursor_position: self.cursor_position.map(|offset| FilePosition { file_id, offset }), | 120 | cursor_position: None, |
121 | is_snippet: false, | ||
118 | } | 122 | } |
119 | } | 123 | } |
120 | } | 124 | } |