Fill deprecation for LSP

This commit is contained in:
kjeremy 2019-02-05 17:05:46 -05:00
parent 569e1e871e
commit 852b083794
6 changed files with 86 additions and 23 deletions

View file

@ -177,6 +177,16 @@ impl Attr {
None
}
}
pub fn as_named(&self) -> Option<SmolStr> {
let tt = self.value()?;
let attr = tt.syntax().children().nth(1)?;
if attr.kind() == IDENT {
Some(attr.leaf_text().unwrap().clone())
} else {
None
}
}
}
impl Comment {