diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_assists/src/handlers/add_missing_impl_members.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/complete_trait_impl.rs | 2 | ||||
-rw-r--r-- | crates/ra_syntax/src/ast/edit.rs | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_assists/src/handlers/add_missing_impl_members.rs b/crates/ra_assists/src/handlers/add_missing_impl_members.rs index e5920b6f6..722f207e2 100644 --- a/crates/ra_assists/src/handlers/add_missing_impl_members.rs +++ b/crates/ra_assists/src/handlers/add_missing_impl_members.rs | |||
@@ -151,7 +151,7 @@ fn add_missing_impl_members_inner( | |||
151 | ast::ImplItem::FnDef(def) => ast::ImplItem::FnDef(add_body(def)), | 151 | ast::ImplItem::FnDef(def) => ast::ImplItem::FnDef(add_body(def)), |
152 | _ => it, | 152 | _ => it, |
153 | }) | 153 | }) |
154 | .map(|it| edit::strip_attrs_and_docs(&it)); | 154 | .map(|it| edit::remove_attrs_and_docs(&it)); |
155 | let new_impl_item_list = impl_item_list.append_items(items); | 155 | let new_impl_item_list = impl_item_list.append_items(items); |
156 | let cursor_position = { | 156 | let cursor_position = { |
157 | let first_new_item = new_impl_item_list.impl_items().nth(n_existing_items).unwrap(); | 157 | let first_new_item = new_impl_item_list.impl_items().nth(n_existing_items).unwrap(); |
diff --git a/crates/ra_ide/src/completion/complete_trait_impl.rs b/crates/ra_ide/src/completion/complete_trait_impl.rs index 7fefa2c7a..ded1ff3bc 100644 --- a/crates/ra_ide/src/completion/complete_trait_impl.rs +++ b/crates/ra_ide/src/completion/complete_trait_impl.rs | |||
@@ -193,7 +193,7 @@ fn add_const_impl( | |||
193 | } | 193 | } |
194 | 194 | ||
195 | fn make_const_compl_syntax(const_: &ast::ConstDef) -> String { | 195 | fn make_const_compl_syntax(const_: &ast::ConstDef) -> String { |
196 | let const_ = edit::strip_attrs_and_docs(const_); | 196 | let const_ = edit::remove_attrs_and_docs(const_); |
197 | 197 | ||
198 | let const_start = const_.syntax().text_range().start(); | 198 | let const_start = const_.syntax().text_range().start(); |
199 | let const_end = const_.syntax().text_range().end(); | 199 | let const_end = const_.syntax().text_range().end(); |
diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs index 68dae008f..324327162 100644 --- a/crates/ra_syntax/src/ast/edit.rs +++ b/crates/ra_syntax/src/ast/edit.rs | |||
@@ -296,11 +296,11 @@ impl ast::UseTree { | |||
296 | } | 296 | } |
297 | 297 | ||
298 | #[must_use] | 298 | #[must_use] |
299 | pub fn strip_attrs_and_docs<N: ast::AttrsOwner>(node: &N) -> N { | 299 | pub fn remove_attrs_and_docs<N: ast::AttrsOwner>(node: &N) -> N { |
300 | N::cast(strip_attrs_and_docs_inner(node.syntax().clone())).unwrap() | 300 | N::cast(remove_attrs_and_docs_inner(node.syntax().clone())).unwrap() |
301 | } | 301 | } |
302 | 302 | ||
303 | fn strip_attrs_and_docs_inner(mut node: SyntaxNode) -> SyntaxNode { | 303 | fn remove_attrs_and_docs_inner(mut node: SyntaxNode) -> SyntaxNode { |
304 | while let Some(start) = | 304 | while let Some(start) = |
305 | node.children_with_tokens().find(|it| it.kind() == ATTR || it.kind() == COMMENT) | 305 | node.children_with_tokens().find(|it| it.kind() == ATTR || it.kind() == COMMENT) |
306 | { | 306 | { |