fix: make pretty printed structure instances hoverable (#7648)

This PR fixes a bug introduced in #7589, causing pretty printed
structure instances to not be hoverable in the Infoview.

This was caused by a choice node being introduced, since `{ $fields,* }`
is ambiguous syntax.
This commit is contained in:
Kyle Miller 2025-03-23 12:36:13 -07:00 committed by GitHub
parent d24dfa1031
commit 414ba28cef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -671,11 +671,9 @@ def delabStructureInstance : Delab := do
paramMap := paramMap.insert (← x.fvarId!.getUserName) param
return paramMap
let (_, fields) ← collectStructFields s.induct paramMap #[] {} s
if ← withType <| getPPOption getPPStructureInstanceType then
let tyStx ← withType delab
`({ $fields,* : $tyStx })
else
`({ $fields,* })
let tyStx? : Option Term ← withType do
if ← getPPOption getPPStructureInstanceType then delab else pure none
`({ $fields,* $[: $tyStx?]? })
/-- State for `delabAppMatch` and helpers. -/