diff options
author | Mikhail Rakhmanov <[email protected]> | 2020-06-13 07:42:15 +0100 |
---|---|---|
committer | Mikhail Rakhmanov <[email protected]> | 2020-06-13 07:42:15 +0100 |
commit | 16bbf4ab7f132e6e5e5318dccdef9a5d71afdd7f (patch) | |
tree | 4b79fa8c046be56b02427ba843e70cdf3ac05767 /crates/ra_ide_db/src/source_change.rs | |
parent | eeb8b9e236796da8734ba81a49164864497f7226 (diff) | |
parent | b56ad148db0c69eb279c225f45d324b4e80e7367 (diff) |
Merge branch 'master' into keyword_completion
# Conflicts:
# docs/user/generated_features.adoc
Diffstat (limited to 'crates/ra_ide_db/src/source_change.rs')
-rw-r--r-- | crates/ra_ide_db/src/source_change.rs | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/crates/ra_ide_db/src/source_change.rs b/crates/ra_ide_db/src/source_change.rs index e713f4b7e..f40ae8304 100644 --- a/crates/ra_ide_db/src/source_change.rs +++ b/crates/ra_ide_db/src/source_change.rs | |||
@@ -22,17 +22,6 @@ impl SourceChange { | |||
22 | ) -> Self { | 22 | ) -> Self { |
23 | SourceChange { source_file_edits, file_system_edits, is_snippet: false } | 23 | SourceChange { source_file_edits, file_system_edits, is_snippet: false } |
24 | } | 24 | } |
25 | |||
26 | /// Creates a new SourceChange with the given label, | ||
27 | /// containing only the given `SourceFileEdits`. | ||
28 | pub fn source_file_edits(edits: Vec<SourceFileEdit>) -> Self { | ||
29 | SourceChange { source_file_edits: edits, file_system_edits: vec![], is_snippet: false } | ||
30 | } | ||
31 | /// Creates a new SourceChange with the given label | ||
32 | /// from the given `FileId` and `TextEdit` | ||
33 | pub fn source_file_edit_from(file_id: FileId, edit: TextEdit) -> Self { | ||
34 | SourceFileEdit { file_id, edit }.into() | ||
35 | } | ||
36 | } | 25 | } |
37 | 26 | ||
38 | #[derive(Debug, Clone)] | 27 | #[derive(Debug, Clone)] |
@@ -43,11 +32,13 @@ pub struct SourceFileEdit { | |||
43 | 32 | ||
44 | impl From<SourceFileEdit> for SourceChange { | 33 | impl From<SourceFileEdit> for SourceChange { |
45 | fn from(edit: SourceFileEdit) -> SourceChange { | 34 | fn from(edit: SourceFileEdit) -> SourceChange { |
46 | SourceChange { | 35 | vec![edit].into() |
47 | source_file_edits: vec![edit], | 36 | } |
48 | file_system_edits: Vec::new(), | 37 | } |
49 | is_snippet: false, | 38 | |
50 | } | 39 | impl From<Vec<SourceFileEdit>> for SourceChange { |
40 | fn from(source_file_edits: Vec<SourceFileEdit>) -> SourceChange { | ||
41 | SourceChange { source_file_edits, file_system_edits: Vec::new(), is_snippet: false } | ||
51 | } | 42 | } |
52 | } | 43 | } |
53 | 44 | ||