diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-10-17 21:05:10 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-17 21:05:10 +0000 |
| commit | 91cbda43c2af82b9377eff70a21f59ade18cd23c (patch) | |
| tree | 0495332ac344fd045b1eb1c08feb52d7acaec753 | |
| parent | 401daa5f77fd9cfb79d16fe3a54bc576d60b4c82 (diff) | |
| parent | 5704de66c271b35ffa6f22aa0b3f8f3f50f7f561 (diff) | |
| download | rust-91cbda43c2af82b9377eff70a21f59ade18cd23c.tar.gz rust-91cbda43c2af82b9377eff70a21f59ade18cd23c.zip | |
Merge #10569
10569: fix: Skip non clippy completions when completing a clippy path r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
| -rw-r--r-- | crates/ide_completion/src/completions/attribute/lint.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/ide_completion/src/completions/attribute/lint.rs b/crates/ide_completion/src/completions/attribute/lint.rs index 4f7930d0dd9..b7ad06d2f08 100644 --- a/crates/ide_completion/src/completions/attribute/lint.rs +++ b/crates/ide_completion/src/completions/attribute/lint.rs @@ -50,8 +50,13 @@ pub(super) fn complete_lint( if lint_already_annotated { continue; } - let insert = match qual { - Some(qual) if !ctx.previous_token_is(T![:]) => format!("{}::{}", qual, name), + let insert = match (qual, ctx.previous_token_is(T![:])) { + (Some(qual), false) => format!("{}::{}", qual, name), + // user is completing a qualified path but this completion has no qualifier + // so discard this completion + // FIXME: This is currently very hacky and will propose odd completions if + // we add more qualified (tool) completions other than clippy + (None, true) => continue, _ => name.to_owned(), }; let mut item = |
