mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Smarter extend selection
This commit is contained in:
parent
9909875bfe
commit
641659d5a8
4 changed files with 53 additions and 22 deletions
|
@ -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> {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue