We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5c82106 + b0d1c9a commit 20fa8abCopy full SHA for 20fa8ab
src/tools/rust-analyzer/crates/ide-completion/src/completions/attribute/cfg.rs
@@ -59,9 +59,14 @@ pub(crate) fn complete_cfg(acc: &mut Completions, ctx: &CompletionContext<'_>) {
59
.into_iter()
60
.map(|x| match x {
61
hir::CfgAtom::Flag(key) => (key.as_str(), "".into()),
62
- hir::CfgAtom::KeyValue { key, .. } => {
63
- (key.as_str(), SmolStr::from_iter([key.as_str(), " = $0"]))
64
- }
+ hir::CfgAtom::KeyValue { key, .. } => (
+ key.as_str(),
+ if ctx.config.snippet_cap.is_some() {
65
+ SmolStr::from_iter([key.as_str(), " = $0"])
66
+ } else {
67
+ SmolStr::default()
68
+ },
69
+ ),
70
})
71
.chain(CFG_CONDITION.iter().map(|&(k, snip)| (k, SmolStr::new_static(snip))))
72
.unique_by(|&(s, _)| s)
0 commit comments