refactor(spec): add selectable legacy and structural editors - #333
Open
Thien Trung Vuong (trungams) wants to merge 2 commits into
Open
Conversation
Thien Trung Vuong (trungams)
force-pushed
the
tvuong/structural-spec-editor-implementation
branch
from
September 2, 2026 23:50
d8cf4b5 to
8457ab8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR puts the existing line-oriented editor and the new structural editor behind the same public
SpecAPI. The legacy implementation remains intact, while the structural implementation uses the parser and tree API introduced in the previous PR.Editor selection happens once when a spec is opened. There are no mode checks scattered through individual operations and no automatic fallback from one editor to the other. This PR also adds a curated set of real-world spec fixtures to exercise the structural implementation. Production continues to use the legacy editor until the rollout configuration is introduced at the top of the stack.
Motivation
Issue #214 calls for structural awareness when editing sections and conditionals. At the same time, azldev is stabilizing and we want an escape hatch during adoption. Keeping both implementations behind one facade gives projects a controlled migration path without changing the public editing API.
Changes
Specas the unchanged public facade.Validation
mage buildmage unitThe cumulative stack was mechanically rebased onto
eb9fb3fand revalidated. The complete rollout was also exercised against the full Azure Linux structural render corpus and the default-legacy E2E suite.Known limitations
Macro preservation during section and subpackage removal is added by the next PR. The structural editor does not evaluate conditional expressions, so content after a wrapper's
%endifcannot always be attributed to a section declared inside that wrapper. There is intentionally no automatic fallback between editors.