mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
move add_missing_members to structured editing API
Currently, this is more code, and we also loose auto-indenting of bodies, but, long-term, this is the right approach
This commit is contained in:
parent
b811922a53
commit
268e739c94
4 changed files with 229 additions and 144 deletions
|
@ -210,6 +210,15 @@ impl ast::EnumVariant {
|
|||
}
|
||||
}
|
||||
|
||||
impl ast::FnDef {
|
||||
pub fn semicolon_token(&self) -> Option<SyntaxToken<'_>> {
|
||||
self.syntax()
|
||||
.last_child_or_token()
|
||||
.and_then(|it| it.as_token())
|
||||
.filter(|it| it.kind() == SEMI)
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::LetStmt {
|
||||
pub fn has_semi(&self) -> bool {
|
||||
match self.syntax().last_child_or_token() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue