Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/ast/edit_in_place.rs')
| -rw-r--r-- | crates/syntax/src/ast/edit_in_place.rs | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/crates/syntax/src/ast/edit_in_place.rs b/crates/syntax/src/ast/edit_in_place.rs index 2b947f2d0f..68e4f956c2 100644 --- a/crates/syntax/src/ast/edit_in_place.rs +++ b/crates/syntax/src/ast/edit_in_place.rs @@ -6,8 +6,6 @@ use parser::T; use crate::{ AstNode, AstToken, Direction, - SyntaxKind::{ATTR, COMMENT, WHITESPACE}, - SyntaxNode, algo::{self, neighbor}, ast::{self, edit::IndentLevel, make, syntax_factory::SyntaxFactory}, syntax_editor::SyntaxEditor, @@ -16,32 +14,6 @@ use crate::{ use super::HasName; -pub trait AttrsOwnerEdit: ast::HasAttrs { - fn remove_attrs_and_docs(&self) { - remove_attrs_and_docs(self.syntax()); - - fn remove_attrs_and_docs(node: &SyntaxNode) { - let mut remove_next_ws = false; - for child in node.children_with_tokens() { - match child.kind() { - ATTR | COMMENT => { - remove_next_ws = true; - child.detach(); - continue; - } - WHITESPACE if remove_next_ws => { - child.detach(); - } - _ => (), - } - remove_next_ws = false; - } - } - } -} - -impl<T: ast::HasAttrs> AttrsOwnerEdit for T {} - impl ast::GenericParamList { /// Constructs a matching [`ast::GenericArgList`] pub fn to_generic_args(&self, make: &SyntaxFactory) -> ast::GenericArgList { |