Add Verity syntax highlighting to docs#1887
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c88dfcb. Configure here.
| ...options, | ||
| themes: [ | ||
| lfglabsCreamTheme, | ||
| ...((options.themes ?? options.theme) ? [] : []), |
There was a problem hiding this comment.
Dead ternary produces identical empty arrays both branches
Low Severity
The expression ...((options.themes ?? options.theme) ? [] : []) is a no-op since both the truthy and falsy branches evaluate to []. The ternary always spreads an empty array regardless of whether options.themes or options.theme exist. This looks like either an incomplete implementation (perhaps meant to forward options.themes) or leftover logic that was never cleaned up.
Reviewed by Cursor Bugbot for commit c88dfcb. Configure here.
| "patterns": [ | ||
| { | ||
| "name": "keyword.other.section.verity", | ||
| "match": "^\\s*\\b(storage|types|inductive|errors|event_defs|constants|immutables|linked_externals)\\b" |
There was a problem hiding this comment.
Grammar match pattern shadows begin/end block pattern
Low Severity
The simple match pattern on line 130 includes linked_externals in its alternation, so it always matches that keyword first. This prevents the begin/end block pattern on line 134 from ever activating. The block was designed to scope the entire linked_externals section with specialized inner patterns and the theme color #53616a, but it's dead code because TextMate grammars try patterns in array order and stop at the first match.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c88dfcb. Configure here.


Summary
withmodifier clauses,nonreentrant(...), effectful calls, ABI projections, field access, event names, and custom errorsnpm run check:highlightingwith an Unlink-shaped sample and 25 required Verity-specific scopesDefinition of Done
verity, not genericlean, when they show contract DSL codeverity_contract, section headers,linked_externals, typedexternaldeclarations,modifier, andfunctionheaders each receive distinct scopeswith onlyRelayer,nonreentrant(...),forEach,requireError,tryExternalCall,abiEncode, andemitare all highlighted by semantic roletxn.proof, typed external returns such asCircuit, event names, and custom errors such asPoolCircuitNotRegistered()receive dedicated scopesnpm run check:highlightingValidation
npm run check:highlightingnpm run build/guides/verity-syntax-highlightinglocally withnext startand captured a screenshot to inspect the actual code-block renderingNotes
next build --webpackbecause Next 16 Turbopack requires serializable MDX loader options, while custom Shiki highlighter hooks are functions.