mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
Skip non clippy completions when completing a clippy path
This commit is contained in:
parent
401daa5f77
commit
5704de66c2
1 changed files with 7 additions and 2 deletions
|
@ -50,8 +50,13 @@ pub(super) fn complete_lint(
|
||||||
if lint_already_annotated {
|
if lint_already_annotated {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let insert = match qual {
|
let insert = match (qual, ctx.previous_token_is(T![:])) {
|
||||||
Some(qual) if !ctx.previous_token_is(T![:]) => format!("{}::{}", qual, name),
|
(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(),
|
_ => name.to_owned(),
|
||||||
};
|
};
|
||||||
let mut item =
|
let mut item =
|
||||||
|
|
Loading…
Reference in a new issue