rustbot · GitHub

@rustbot added the S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

label

Jul 28, 2026

ChayimFriedman2

ChayimFriedman2

Postfix custom snippets are never considered by completion when
`scope` is `item` (only `Expr`-scoped postfix snippets are checked in
completions::postfix), so this combination previously created a
snippet that silently never fired.
Validate the combination during deserialization of `SnippetDef` via
`#[serde(try_from = "SnippetDefRepr")]`. Both the client JSON config
and `rust-analyzer.toml` configs deserialize a `SnippetDef` per map
entry, so this covers both config sources with one check.
Trade-off: because the check now runs during `FxIndexMap<String,
SnippetDef>` deserialization, one invalid entry fails deserialization
of the whole custom-snippets map, falling back to the built-in default
snippets rather than dropping only the bad entry. This matches how any
other structurally invalid `SnippetDef` field already behaves.
Fixes rust-lang#22894

@Joshuaisikah

ChayimFriedman2

@ChayimFriedman2

@ChayimFriedman2

@Joshuaisikah

Read the original on github.com ↗