This commit is contained in:
Lukas Wirth
2022-05-10 14:31:28 +02:00
parent 822d9b55b7
commit 26fef97d59
3 changed files with 16 additions and 10 deletions

View File

@@ -65,6 +65,19 @@ impl<'a> RenderContext<'a> {
}
}
fn is_immediately_after_macro_bang(&self) -> bool {
self.completion.token.kind() == SyntaxKind::BANG
&& self
.completion
.token
.parent()
.map_or(false, |it| it.kind() == SyntaxKind::MACRO_CALL)
}
pub(crate) fn path_is_call(&self) -> bool {
self.completion.path_context().map_or(false, |it| it.has_call_parens)
}
fn is_deprecated(&self, def: impl HasAttrs) -> bool {
let attrs = def.attrs(self.db());
attrs.by_key("deprecated").exists() || attrs.by_key("rustc_deprecated").exists()