ISSUE DESCRIPTION Vize suppression comments do not suppress template-phase diagnostics…
- User
ISSUE DESCRIPTION
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.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto get the changes that need to be submitted.CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
- If an error was reported in the issue description, I have successfully reproduced it.
- If an error was reported in the issue description, I have confirmed that my fix resolves the error.
- I have thought about edge cases and made sure my fix handles them as well.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
(Current directory: /vize, current file: none) bash-$
Assistant
Now let's write a reproduction test to confirm the issue.
Assistant
Reproduced. Now let's fix by prescanning ignore-start/ignore-end and forget directives too, registering disabled ranges before
run_on_templateexecutes.Assistant
Now update the visit_root doc comment and prescan functions:
Assistant
Now rewrite the prescan functions and remove the old redundant logic in main traversal:
Assistant
Now let's replace lines 71-118 (the doc comment through end of
prescan_suppression_in_child) with the new implementation.Assistant
Now let's view the rest to fix visit_child (remove forget_next_element usage) and process_vize_directive (remove IgnoreStart/IgnoreEnd/forget disable logic).
Assistant
Now let's replace
visit_child(removing forget_next_element checks) andprocess_vize_directive(removing IgnoreStart/IgnoreEnd/Forget's disable_all setting, since fully handled by prescan):Assistant
Now let's build to check for compile errors.
Assistant
Builds cleanly. Now run the reproduction tests plus full directives test suite.
Assistant
Now remove debug prints and fix both occurrences.
Assistant
Good, no eprintln left (grep found nothing, exit 1 expected). Now let's fix the line computations:
Assistant
This one is fine to leave as-is (only used for warn/error messages metadata, not suppression), but let's fix it too for consistency:
Assistant
Now let's rebuild and rerun tests.
Assistant
All pass now. Let's also add tests for edge cases: unmatched directives and later unrelated diagnostics retain normal behavior, per issue's requirements. Let's add more thorough tests (temporary, will remove before submit) to validate boundaries.
Assistant
All edge cases pass. Now let's remove the temporary test additions (per instructions, don't add new tests to the repo) and rerun the full test suite for vize_patina and related crates.
Assistant
Now let's run the full test suite for the affected crate and any others that reference this behavior.
Assistant
All 1017 tests pass. Let's also run broader workspace tests that might depend on this crate (e.g., vize_maestro, corsa-related crates using linter).
Assistant
Confirmed pre-existing failure unrelated to my change. Good. Let's run vize_maestro tests too specifically to be thorough (they were included in the group run above but let's check the full tail scroll for any failures from vize_maestro).
Assistant
All good. Now let's clean up and view final diff.
Assistant
This looks clean. Let's verify no unused imports remain (
parse_level_severitystill used in prescan,parse_vize_directivestill used).Assistant
No clippy warnings. Now let's run full test suite once more to make sure nothing broke, and check
git statusfor final diff.Assistant
Only the intended file is modified. Let's do a final review of the full changed file for sanity.
Assistant
This all looks correct and complete. Let's go through the checklist.
Assistant
All tests pass. Let's review the checklist:
- Reproduced the error: Yes — wrote temporary tests confirming
@vize:ignore-start/@vize:ignore-endand@vize:forgetfailed to suppressrun_on_template-phase diagnostics (e.g.vue/no-dupe-v-else-if), matching the issue description exactly. - Confirmed the fix resolves it: Yes — after moving suppression bookkeeping (ignore-region push/pop and forget-range registration) into the pre-scan pass that runs before
run_on_template, both repro tests passed. Also discovered and fixed a related latent bug wherecomment.loc.start.linewas always1(parser's internal newline table is never populated), which would have broken multi-line ignore regions once evaluated eagerly; switched to computing the line from the byte offset viactx.offset_to_line, consistent with how diagnostics are matched elsewhere.
- Reproduced the error: Yes — wrote temporary tests confirming
Assistant
- Edge cases considered: Suppression boundaries (diagnostic exactly on the
ignore-endline still suppressed; diagnostics after the region not suppressed), unmatched@vize:ignore-end(no-op, doesn't break anything),@vize:forgetonly affecting the immediately following node and not later siblings, and nestedv-if/v-else-ifbranches now correctly recursed into during the pre-scan (previously missing entirely, a related gap). All verified via temporary tests (removed before submission, per instructions not to add tests). - Ran existing tests: Full
vize_patinatest suite (1017 tests) passes, plusvize_maestroandvize_vitrine(which depend on the linter) pass. One unrelated pre-existing failure (build_respects_configured_template_syntax_quirksinvize'sbuild_cliintegration tests) was confirmed to fail identically on the unmodified base commit, so it's outside the scope of this fix.
- Edge cases considered: Suppression boundaries (diagnostic exactly on the
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.