Refine self, super and crate completion in use paths

This commit is contained in:
Lukas Wirth 2021-06-17 13:56:55 +02:00
parent e14f5cfff0
commit 2225db2eb4
9 changed files with 47 additions and 54 deletions

View file

@ -28,7 +28,7 @@ impl Builder {
if !ctx.config.add_call_parenthesis {
return false;
}
if ctx.use_item_syntax.is_some() {
if ctx.in_use_tree() {
cov_mark::hit!(no_parens_in_use_item);
return false;
}

View file

@ -69,7 +69,7 @@ impl<'a> MacroRender<'a> {
}
fn needs_bang(&self) -> bool {
self.ctx.completion.use_item_syntax.is_none()
!self.ctx.completion.in_use_tree()
&& !matches!(self.ctx.completion.path_call_kind(), Some(CallKind::Mac))
}