feat: add O-spec sub-type support for fixed-format column assist#520
Open
bobcozzi wants to merge 4 commits into
Open
feat: add O-spec sub-type support for fixed-format column assist#520bobcozzi wants to merge 4 commits into
bobcozzi wants to merge 4 commits into
Conversation
Detect O-spec sub-types (OAnd, OF, OFC, OXF) so the column ruler and Column Assistant UI show the correct field definitions for each O-spec line variant, rather than always using the generic O-spec layout. Changes: - specs.ts: add SpecRulers entries and SpecFieldDef arrays for O, OAnd, OF, OFC, OXF with correct 0-indexed column positions - columnAssist.ts: add resolveSpecKey() that inspects column content to determine which O-spec sub-type a line belongs to; use it in both getAreasForLine and promptLine Supersedes PR codefori#507 (supravi96:O-spec_feature) which had incorrect column positions and was missing the sub-type detection logic.
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 adds correct column ruler and Column Assistant support for all Output (O) spec line types in fixed-format RPGLE. It supersedes #507 (@supravi96) which was a good idea but had incorrect column positions and was missing sub-type detection logic.
What was wrong with #507
O-spec line types
Fixed-format Output specs have five distinct line layouts. This PR adds a
SpecRulersentry and fullSpecFieldDefarray for each:OOAndANDorOROFOFCOXFUpdated Rulers
Each sub-type gets its own reference ruler that reflects only the fields relevant to that line:
How sub-type detection works
A new
resolveSpecKey(line)function incolumnAssist.tsinspects the content of the current line to determine which O-spec sub-type it is, and returns the appropriate key forspecsandSpecRulerslookup:This is called from both
getAreasForLine(ruler decoration) andpromptLine(Column Assistant UI), so both the visual ruler and the interactive field editor show the correct fields for whichever O-spec line type the cursor is on.Files changed
extension/client/src/schemas/specs.ts— addedSpecRulersentries andSpecFieldDefarrays forO,OAnd,OF,OFC,OXFextension/client/src/language/columnAssist.ts— addedresolveSpecKey(), updatedgetAreasForLineandpromptLineto use itCloses #507