Smarter extend selection

This commit is contained in:
Aleksey Kladov 2018-08-22 11:56:36 +03:00
parent 9909875bfe
commit 641659d5a8
4 changed files with 53 additions and 22 deletions

View file

@ -641,3 +641,21 @@ impl<'a> AstNode<'a> for TypeRef<'a> {
impl<'a> TypeRef<'a> {}
// Whitespace
#[derive(Debug, Clone, Copy)]
pub struct Whitespace<'a> {
syntax: SyntaxNodeRef<'a>,
}
impl<'a> AstNode<'a> for Whitespace<'a> {
fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> {
match syntax.kind() {
WHITESPACE => Some(Whitespace { syntax }),
_ => None,
}
}
fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax }
}
impl<'a> Whitespace<'a> {}