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 trace how suppression comments are applied and where template-phase diagnostics are emitted so we can fix the gap.
- Assistant
Extending the pre-scan to register ignore regions and forget ranges before
run_on_template, and adding regression tests. - Assistant
Adding regression tests for template-phase suppression:
- Assistant
Forget only covers the next element — I'll adjust the test so the directive sits right before the element that gets the diagnostic.
- Assistant
Checking whether comment line numbers match
offset_to_line: - Assistant
Using
offset_to_linefor ignore regions to match diagnostic line lookup. - Assistant
The issue was a line-number mismatch — switching ignore regions to
offset_to_line. Removing the debug test and running the full suite. - Assistant
Template-phase diagnostics were emitted before suppression directives were registered. The fix pre-scans
@vize:ignore-start,@vize:ignore-end, and@vize:forgetin document order beforerun_on_templateruns.Cause
The pre-scan from #968 only handled
@vize:expectedand@vize:level.@vize:ignore-start/@vize:ignore-endand@vize:forgetwere still applied during the main AST walk, which runs after template-phase rules likevue/no-dupe-v-else-ifandvue/no-unused-vars.Fix (
crates/vize_patina/src/visitor.rs)-
Expanded pre-scan — Walks the AST in document order (including
If/Fornodes) and registers:- ignore regions (
push_ignore_region/pop_ignore_region) @vize:forgetranges ( on the next element/if/for)
- ignore regions (
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.