aboutsummaryrefslogtreecommitdiff
path: root/crates/syntax/src/ast
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-03-16 19:59:57 +0000
committerAleksey Kladov <[email protected]>2021-03-16 19:59:57 +0000
commit186a430853176f0ff5f69c4323bd12fb6f07d6ed (patch)
treec7c2d2521f76f56f1e808edc8f88a2fd29dd166a /crates/syntax/src/ast
parent34555593caeea25d460703e25c446b13132b1c5b (diff)
pit-of-successify tree editor
Diffstat (limited to 'crates/syntax/src/ast')
-rw-r--r--crates/syntax/src/ast/edit_in_place.rs6
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 {
102fn create_where_clause(position: Position) { 102fn 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
108impl ast::WhereClause { 108impl 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