mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-28 05:53:45 +00:00
Use syntax's version of SyntaxElement
This commit is contained in:
parent
cc4e06f04b
commit
92422f7488
1 changed files with 3 additions and 4 deletions
|
@ -3,13 +3,12 @@
|
||||||
use std::iter::{empty, successors};
|
use std::iter::{empty, successors};
|
||||||
|
|
||||||
use parser::{SyntaxKind, T};
|
use parser::{SyntaxKind, T};
|
||||||
use rowan::SyntaxElement;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
algo::{self, neighbor},
|
algo::{self, neighbor},
|
||||||
ast::{self, edit::IndentLevel, make, HasGenericParams},
|
ast::{self, edit::IndentLevel, make, HasGenericParams},
|
||||||
ted::{self, Position},
|
ted::{self, Position},
|
||||||
AstNode, AstToken, Direction,
|
AstNode, AstToken, Direction, SyntaxElement,
|
||||||
SyntaxKind::{ATTR, COMMENT, WHITESPACE},
|
SyntaxKind::{ATTR, COMMENT, WHITESPACE},
|
||||||
SyntaxNode, SyntaxToken,
|
SyntaxNode, SyntaxToken,
|
||||||
};
|
};
|
||||||
|
@ -577,7 +576,7 @@ impl ast::AssocItemList {
|
||||||
None => (IndentLevel::single(), Position::last_child_of(self.syntax()), "\n"),
|
None => (IndentLevel::single(), Position::last_child_of(self.syntax()), "\n"),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
let elements: Vec<SyntaxElement<_>> = vec![
|
let elements: Vec<SyntaxElement> = vec![
|
||||||
make::tokens::whitespace(&format!("{whitespace}{indent}")).into(),
|
make::tokens::whitespace(&format!("{whitespace}{indent}")).into(),
|
||||||
item.syntax().clone().into(),
|
item.syntax().clone().into(),
|
||||||
];
|
];
|
||||||
|
@ -771,7 +770,7 @@ impl ast::VariantList {
|
||||||
None => (IndentLevel::single(), Position::last_child_of(self.syntax())),
|
None => (IndentLevel::single(), Position::last_child_of(self.syntax())),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
let elements: Vec<SyntaxElement<_>> = vec![
|
let elements: Vec<SyntaxElement> = vec![
|
||||||
make::tokens::whitespace(&format!("{}{indent}", "\n")).into(),
|
make::tokens::whitespace(&format!("{}{indent}", "\n")).into(),
|
||||||
variant.syntax().clone().into(),
|
variant.syntax().clone().into(),
|
||||||
ast::make::token(T![,]).into(),
|
ast::make::token(T![,]).into(),
|
||||||
|
|
Loading…
Reference in a new issue