Repository navigation
Conversation
The mapped-source retention in #583 needs to attach authored text to a provider map's file entries; the pin targets the workshop-rs commit adding that API and retargets to crates.io once it ships. The pinned rev also classifies near-miss settings spellings as catalog-spelling-near-miss (workshop-rs#406): wright maps the new residual to unsupported like the other uncatalogued classes, and the raw-setting test names the new code.
Provider-mapped programs registered their file table but retained no source text, so lint fixes could not resolve authored extents, and the dead-branch scanner only knew Workshop keywords — an OPY elif/else/dedent boundary produced fix: null. The session now retains each mapped member's text after SourceMap::apply (Program::set_file_source), and dead_branch_fix prefers the marker actions' authored spans (if/elif/else keywords, End at the dedent) with the Workshop text scan as fallback for unmarked programs. Materialized mapped edits name the member's file:// URI under the authored text's identity and validate through providerValidateEdits + check; --write resolves URIs before replacing files. Unmapped artifacts still carry no fix. Fixes #583
SourceMap::apply rebinds the program's file table, but the inertly carried settings tree kept spans in the parsed text's coordinate space. Once the session retains each mapped member's authored text (set_file_source), those stale positions fail Program::validate's bounds check — wright compile errors with invalid-span on any OPY project with a settings block (wright#583, bench seeds 'modify-opy-project', 'understand-opy-project', 'greenfield-opy-elimination-race', 'repair-opy-runaway-loop', 'renamed-callable-*', 'ana-paintball'). The map's contract is that nodes without an entry carry no span; workshop-rs 62b20df clears the settings tree's spans on apply since no map entry can express settings provenance.
The pin to a git rev of feat/program-set-file-source was a stopgap until Program::set_file_source shipped. workshop-rs 1.12.0 releases it together with the source-map fix that clears stale settings spans when apply rebinds the file table (wright#583), so the [patch.crates-io] section is removed.
|
CI classification for the |
Summary
wright lint --fixon a provider-backed OPY project reportedduplicate-conditionwithfix: null: the mappedProgramregistered the provider's file table but retained no source text, and the dead-branch scanner only understood WorkshopElse If/Else/Endkeywords. Two changes close the gap:SourceMap::apply, the session retains each mapped member's authored text (Program::set_file_source, pinned workshop-rs rev6a97b5c), soProgram::sourceresolves for source extents, identity preconditions, and previews.dead_branch_fixprefers the chain markers' authored action spans —if/elif/elsekeywords andEndat the dedent boundary, emitted byopy-rssince feat(lowering): attribute if-chain markers to authored keyword spans opy-rs#504 — and keeps the Workshop text scanner as fallback for marker-less programs.Mapped fixes materialize as
SourceEdits naming the member'sfile://URI under the authored text's identity, then validate through the existing provider pipeline (lpp/validateEdits+lpp/check) instead of the raw Workshop reparse;write_previewsresolves URI sources before its atomic replace. Unmapped artifacts carry no fix, and provider-side failures surface as structured refusals.The dependency commit also folds in the pinned rev's
catalog-spelling-near-missclassification (workshop-rs#406), mapped tounsupportedwith the other uncatalogued residuals.Fixes #583
Test plan
mapped_lint_fix_validates_and_writes_through_the_provider— fake LPP provider + injected marker map: preview names the authored member with full original/fixed OPY text,lpp/validateEditsandlpp/checkare exercised,--writeapplies and re-lints cleaninvalid-spanagainst retained text);mapped_lint_sessionfixtures now write the mapped text as the memberopy-providerend-to-end:lint --fixpreviews and--writeremoves a duplicateelifacrosselif→elif,elif→else, andelif→dedent boundaries, including nested blockslint --fix/--writeregression pass (lint_fix,lint_fixes, cli suites)cargo fmt --all -- --check,cargo clippy --workspace --all-targets --all-features -- -D warnings,cargo test --workspace --all-targets --all-features