Skip to content

Commit 5704de6

Browse files
committed
Skip non clippy completions when completing a clippy path
1 parent 401daa5 commit 5704de6

File tree

1 file changed

+7
-2
lines changed
  • crates/ide_completion/src/completions/attribute

1 file changed

+7
-2
lines changed

crates/ide_completion/src/completions/attribute/lint.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,13 @@ pub(super) fn complete_lint(
5050
if lint_already_annotated {
5151
continue;
5252
}
53-
let insert = match qual {
54-
Some(qual) if !ctx.previous_token_is(T![:]) => format!("{}::{}", qual, name),
53+
let insert = match (qual, ctx.previous_token_is(T![:])) {
54+
(Some(qual), false) => format!("{}::{}", qual, name),
55+
// user is completing a qualified path but this completion has no qualifier
56+
// so discard this completion
57+
// FIXME: This is currently very hacky and will propose odd completions if
58+
// we add more qualified (tool) completions other than clippy
59+
(None, true) => continue,
5560
_ => name.to_owned(),
5661
};
5762
let mut item =

0 commit comments

Comments
 (0)