Vize suppression comments do not suppress template-phase diagnostics @vize:ignore-start…
- User
Vize suppression comments do not suppress template-phase diagnostics
@vize:ignore-start/@vize:ignore-endregions and@vize:forgetmust suppress matching diagnostics even when the affected rule runs during the template phase. Suppression boundaries, unmatched directives, and later unrelated diagnostics must retain their normal behavior.Interface
No new interfaces are introduced.
- Assistant
I'll investigate how Vize suppression comments interact with template-phase diagnostics in the codebase.
- Assistant
Implementing prescan support for
ignore-start/ignore-endandforget, then adding regression tests. - Assistant
The issue is suppression used
comment.loc.start.line(often wrong) while diagnostics useoffset_to_line. Switching suppression tooffset_to_line. - Assistant
Fixed suppression so
@vize:ignore-start/@vize:ignore-endand@vize:forgetapply to template-phase diagnostics.Two issues were involved:
-
Pre-scan gap — Only
@vize:expectedand@vize:levelwere registered beforerun_on_template.@vize:ignore-start/endand@vize:forgetwere handled only during traversal, which runs after template-phase rules. -
Line number mismatch — Suppression used
comment.loc.start.line(often wrong in the AST), while diagnostics useoffset_to_line(offset). That made ignore regions collapse to a single line (e.g.{1, 1}instead of{1, 3}), so line 2 diagnostics were not suppressed.
Changes
crates/vize_patina/src/visitor.rs- Extended pre-scan to register
@vize:ignore-start,@vize:ignore-end, and@vize:forgetbeforerun_on_template - Pre-scan now recurses through
Ifbranches (same as main traversal)
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.