Skip to content

Commit

Permalink
fix: don't render all branches of choice nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
david-christiansen committed Mar 21, 2024
1 parent cd4d0a3 commit f097729
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/highlighting/SubVerso/Highlighting/Code.lean
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,13 @@ partial def highlight' (ids : HashMap Lsp.RefIdent Lsp.RefIdent) (trees : Persis
| _, _ =>
highlight' ids trees dot
highlight' ids trees name
| .node _ `choice alts =>
-- Arbitrarily select one of the alternatives found by the parser. Otherwise, quotations of
-- let-bindings with antiquotations as the bound variable leads to doubled bound variables,
-- because the parser emits a choice node in the quotation. And it's never correct to show
-- both alternatives!
if h : alts.size > 0 then
highlight' ids trees alts[0]
| stx@(.node _ k children) =>
let pos := stx.getPos?
for child in children do
Expand Down

0 comments on commit f097729

Please sign in to comment.