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
Single
visit_rootper context — good. Let me confirm the bug with a reproduction test first. - Assistant
Now remove the duplicated registration from the main traversal:
- Assistant
Forget tests pass now, but ignore-region tests fail — including the pre-existing one. Let me debug:
- Assistant
All tests pass and the diff is clean.
Summary
Root cause — two stacked issues in
crates/vize_patina/src/visitor.rs:- Late registration:
run_on_templaterules (e.g.vue/no-dupe-v-else-if,vue/no-mutating-props) fire before the per-element traversal reaches the comment nodes, so@vize:ignore-start/-endregions and@vize:forgetranges were registered too late to suppress template-phase diagnostics. The existing pre-scan (#968) only covered@vize:expected/@vize:level. - Wrong coordinate system: comment nodes carry a broken
loc.start.line(the armature parser'snewlinesvec atparser.rs:53is never populated, soget_posalways reports line 1). This was masked before because regions were checked while still open; once regions are closed up-front, exact lines matter.
Fix (
crates/vize_patina/src/visitor.rs):- Extended the pre-scan to register
IgnoreStart/IgnoreEndregions andForgetdisable ranges (via a newapply_pending_forgethelper that mirrors the old next-element semantics forElement/If/Fornodes), and addedIf-branch recursion so directives inside branches are still found. - Derive directive lines with
ctx.offset_to_line(comment.loc.start.offset)— the same mappingreport()uses for diagnostics — instead of the unreliableloc.start.line. - Removed the now-redundant suppression bookkeeping from the main traversal; only diagnostic-emitting directives (Todo, Fixme, Deprecated, Forget's missing-reason warning) remain there, so ordering-sensitive behavior is unchanged.
Tests (
crates/vize_patina/src/linter/tests/directives.rs) — 6 new regression tests covering: ignore region suppressing a template-phase rule, region boundary respected (later diagnostic still reported), unmatchedignore-endas no-op, unclosedignore-startsuppressing to EOF,@vize:forgetsuppressing a template-phase diagnostic, and forget not leaking past the next element.Verified:
cargo test -p vize_patina --lib(1023 passed, was 5 failing pre-fix),cargo test -p vize_maestro --lib(300 passed),cargo fmt, and clippy adds no new warnings.One heads-up: the underlying parser bug (all
create_locpositions invize_armature/src/parser.rsreport line 1 because itsnewlineslist is never filled) still exists and may affect other consumers of AST line numbers. I left it alone since fixing it has a wide blast radius — worth a separate issue. - Late registration:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- fable-5Compare side by side →