diff options
author | Aleksey Kladov <[email protected]> | 2021-03-16 19:59:57 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-03-16 19:59:57 +0000 |
commit | 186a430853176f0ff5f69c4323bd12fb6f07d6ed (patch) | |
tree | c7c2d2521f76f56f1e808edc8f88a2fd29dd166a /crates/syntax/src/ast | |
parent | 34555593caeea25d460703e25c446b13132b1c5b (diff) |
pit-of-successify tree editor
Diffstat (limited to 'crates/syntax/src/ast')
-rw-r--r-- | crates/syntax/src/ast/edit_in_place.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/syntax/src/ast/edit_in_place.rs b/crates/syntax/src/ast/edit_in_place.rs index 7adfe5e16..449b058fb 100644 --- a/crates/syntax/src/ast/edit_in_place.rs +++ b/crates/syntax/src/ast/edit_in_place.rs | |||
@@ -102,17 +102,17 @@ impl GenericParamsOwnerEdit for ast::Enum { | |||
102 | fn create_where_clause(position: Position) { | 102 | fn create_where_clause(position: Position) { |
103 | let where_clause: SyntaxElement = | 103 | let where_clause: SyntaxElement = |
104 | make::where_clause(empty()).clone_for_update().syntax().clone().into(); | 104 | make::where_clause(empty()).clone_for_update().syntax().clone().into(); |
105 | ted::insert_ws(position, where_clause); | 105 | ted::insert(position, where_clause); |
106 | } | 106 | } |
107 | 107 | ||
108 | impl ast::WhereClause { | 108 | impl ast::WhereClause { |
109 | pub fn add_predicate(&self, predicate: ast::WherePred) { | 109 | pub fn add_predicate(&self, predicate: ast::WherePred) { |
110 | if let Some(pred) = self.predicates().last() { | 110 | if let Some(pred) = self.predicates().last() { |
111 | if !pred.syntax().siblings_with_tokens(Direction::Next).any(|it| it.kind() == T![,]) { | 111 | if !pred.syntax().siblings_with_tokens(Direction::Next).any(|it| it.kind() == T![,]) { |
112 | ted::append_child(self.syntax().clone(), make::token(T![,])); | 112 | ted::append_child_raw(self.syntax().clone(), make::token(T![,])); |
113 | } | 113 | } |
114 | } | 114 | } |
115 | ted::append_child_ws(self.syntax().clone(), predicate.syntax().clone()) | 115 | ted::append_child(self.syntax().clone(), predicate.syntax().clone()) |
116 | } | 116 | } |
117 | } | 117 | } |
118 | 118 | ||