diff options
Diffstat (limited to 'crates/ra_editor/src/typing.rs')
-rw-r--r-- | crates/ra_editor/src/typing.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_editor/src/typing.rs b/crates/ra_editor/src/typing.rs index 21d068a7b..dd3d0f260 100644 --- a/crates/ra_editor/src/typing.rs +++ b/crates/ra_editor/src/typing.rs | |||
@@ -21,7 +21,7 @@ pub fn join_lines(file: &SourceFileNode, range: TextRange) -> LocalEdit { | |||
21 | None => { | 21 | None => { |
22 | return LocalEdit { | 22 | return LocalEdit { |
23 | label: "join lines".to_string(), | 23 | label: "join lines".to_string(), |
24 | edit: TextEditBuilder::new().finish(), | 24 | edit: TextEditBuilder::default().finish(), |
25 | cursor_position: None, | 25 | cursor_position: None, |
26 | }; | 26 | }; |
27 | } | 27 | } |
@@ -33,7 +33,7 @@ pub fn join_lines(file: &SourceFileNode, range: TextRange) -> LocalEdit { | |||
33 | }; | 33 | }; |
34 | 34 | ||
35 | let node = find_covering_node(file.syntax(), range); | 35 | let node = find_covering_node(file.syntax(), range); |
36 | let mut edit = TextEditBuilder::new(); | 36 | let mut edit = TextEditBuilder::default(); |
37 | for node in node.descendants() { | 37 | for node in node.descendants() { |
38 | let text = match node.leaf_text() { | 38 | let text = match node.leaf_text() { |
39 | Some(text) => text, | 39 | Some(text) => text, |
@@ -76,7 +76,7 @@ pub fn on_enter(file: &SourceFileNode, offset: TextUnit) -> Option<LocalEdit> { | |||
76 | let indent = node_indent(file, comment.syntax())?; | 76 | let indent = node_indent(file, comment.syntax())?; |
77 | let inserted = format!("\n{}{} ", indent, prefix); | 77 | let inserted = format!("\n{}{} ", indent, prefix); |
78 | let cursor_position = offset + TextUnit::of_str(&inserted); | 78 | let cursor_position = offset + TextUnit::of_str(&inserted); |
79 | let mut edit = TextEditBuilder::new(); | 79 | let mut edit = TextEditBuilder::default(); |
80 | edit.insert(offset, inserted); | 80 | edit.insert(offset, inserted); |
81 | Some(LocalEdit { | 81 | Some(LocalEdit { |
82 | label: "on enter".to_string(), | 82 | label: "on enter".to_string(), |
@@ -127,7 +127,7 @@ pub fn on_eq_typed(file: &SourceFileNode, offset: TextUnit) -> Option<LocalEdit> | |||
127 | return None; | 127 | return None; |
128 | } | 128 | } |
129 | let offset = let_stmt.syntax().range().end(); | 129 | let offset = let_stmt.syntax().range().end(); |
130 | let mut edit = TextEditBuilder::new(); | 130 | let mut edit = TextEditBuilder::default(); |
131 | edit.insert(offset, ";".to_string()); | 131 | edit.insert(offset, ";".to_string()); |
132 | Some(LocalEdit { | 132 | Some(LocalEdit { |
133 | label: "add semicolon".to_string(), | 133 | label: "add semicolon".to_string(), |