Skip to content
TheChatArchiveThe Chat Archive
fable-5· unknownHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

Vize suppression comments do not suppress template-phase diagnostics @vize:ignore-start…

  1. User

    Vize suppression comments do not suppress template-phase diagnostics

    @vize:ignore-start / @vize:ignore-end regions and @vize:forget must 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.

  2. Assistant

    Single visit_root per context — good. Let me confirm the bug with a reproduction test first.

  3. Assistant

    Now remove the duplicated registration from the main traversal:

  4. Assistant

    Forget tests pass now, but ignore-region tests fail — including the pre-existing one. Let me debug:

  5. Assistant

    All tests pass and the diff is clean.

    Summary

    Root cause — two stacked issues in crates/vize_patina/src/visitor.rs:

    1. Late registration: run_on_template rules (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/-end regions and @vize:forget ranges were registered too late to suppress template-phase diagnostics. The existing pre-scan (#968) only covered @vize:expected / @vize:level.
    2. Wrong coordinate system: comment nodes carry a broken loc.start.line (the armature parser's newlines vec at parser.rs:53 is never populated, so get_pos always 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/IgnoreEnd regions and Forget disable ranges (via a new apply_pending_forget helper that mirrors the old next-element semantics for Element/If/For nodes), and added If-branch recursion so directives inside branches are still found.
    • Derive directive lines with ctx.offset_to_line(comment.loc.start.offset) — the same mapping report() uses for diagnostics — instead of the unreliable loc.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), unmatched ignore-end as no-op, unclosed ignore-start suppressing to EOF, @vize:forget suppressing 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_loc positions in vize_armature/src/parser.rs report line 1 because its newlines list 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.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.