diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index 9a44afc67e3..ffd115cef90 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs @@ -25,13 +25,6 @@ pub trait AstNode: fn syntax(&self) -> &SyntaxNode; } -pub trait AstToken: AstNode { - fn text(&self) -> &SmolStr { - // self.syntax().leaf_text().unwrap() - unimplemented!() - } -} - pub trait TypeAscriptionOwner: AstNode { fn ascribed_type(&self) -> Option<&TypeRef> { child_opt(self) diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 435d90116ef..c2e89de1501 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs @@ -4375,32 +4375,3 @@ impl WhileExpr { } } -// Whitespace -#[derive(Debug, PartialEq, Eq, Hash)] -#[repr(transparent)] -pub struct Whitespace { - pub(crate) syntax: SyntaxNode, -} -unsafe impl TransparentNewType for Whitespace { - type Repr = rowan::SyntaxNode; -} - -impl AstNode for Whitespace { - fn cast(syntax: &SyntaxNode) -> Option<&Self> { - match syntax.kind() { - WHITESPACE => Some(Whitespace::from_repr(syntax.into_repr())), - _ => None, - } - } - fn syntax(&self) -> &SyntaxNode { &self.syntax } -} - -impl ToOwned for Whitespace { - type Owned = TreeArc; - fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } -} - - -impl ast::AstToken for Whitespace {} -impl Whitespace {} - diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index 3d97bea7f56..dc0de5808a9 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron @@ -664,6 +664,5 @@ Grammar( "TypeArg": (options: ["TypeRef"]), "AssocTypeArg": (options: ["NameRef", "TypeRef"]), "LifetimeArg": (), - "Whitespace": ( traits: ["AstToken"] ), }, )