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:
Aleksey Kladov 2019-04-22 13:01:33 +03:00
parent b811922a53
commit 268e739c94
4 changed files with 229 additions and 144 deletions

View file

@ -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() {