feat(format): mimic option-list spacing in format:inline - #1716
Conversation
VALUE |format:inline joins picks with ", " when every option-list comma is followed by horizontal whitespace. Mixed lists, compact lists, and FIELD/FILE inline stay ",". Fixes #1701 Co-authored-by: Christian Bager Bach Houmann <christian@bagerbach.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (11)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthrough
ChangesInline multi-select spacing
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This change only preserves authored comma spacing for inline VALUE option lists while leaving other formatting paths unchanged. No actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant VALUEToken
participant parseValueToken
participant scanQuotedCommaList
participant resolveMultiValueFormat
participant renderExplicitMultiValue
VALUEToken->>parseValueToken: provide option list and format
parseValueToken->>scanQuotedCommaList: scan values and comma spacing
scanQuotedCommaList-->>parseValueToken: return fields and delimiter spacing
parseValueToken->>resolveMultiValueFormat: resolve inline separator
resolveMultiValueFormat-->>parseValueToken: return structured multiFormat
parseValueToken->>renderExplicitMultiValue: pass resolved format and values
renderExplicitMultiValue-->>VALUEToken: render inline text
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The implementation satisfies issue Full details: Docstring CoverageExplanation Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 10 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying quickadd with
|
| Latest commit: |
0a16429
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b9786a68.quickadd.pages.dev |
| Branch Preview URL: | https://cursor-inline-format-whitesp.quickadd.pages.dev |
Summary
{{VALUE:option a, option b|multi|format:inline}}now insertsoption a, option b. A compact list still insertsoption a,option b. That is the spacing the author already wrote in the option list. There is no new|separator:flag.Fixes #1701
Changes
ResolvedMultiValueFormatcarries anInlineSeparatoronly on the inline arm.MultiValueFormatstays the|format:keyword.parseValueTokeninfers","vs", "from delimiter commas in the VALUE option list. Quoted commas are not delimiters. Mixed spacing stays compact.resolveMultiValueFormat(keyword)with no evidence, so their inline output staysAlpha,Beta.splitQuotedCommaListstays exported. It is a projection of a private scan.FormatSyntax.mddescribe the VALUE mimic rule.Tradeoffs
Unanimous-or-compact mixed lists.
a, b,cstaysa,b. A stray missing space does not flip the whole list. Existing VALUE templates that already wrote,in the option list and used|format:inlinewill start emitting spaces. That is the requested behavior.auto,yaml, andmarkdownare unchanged, including therawValue.join(",")body-text fallback.Blast Radius
Template authors who use
|format:inlineon VALUE option lists. FIELD/FILE inline, auto, yaml, and markdown readers see no change. The resolved union replaces the stringmultiFormaton parsed VALUE/FILE tokens. In-repo tests were updated. Out-of-tree imports ofMultiValueFormatas a string still compile.ParsedValueToken.multiFormatis now an object.Testing / validation
pnpm exec vitest runon the formatter/parser files: 8 files, 313 tests passed.pnpm run test: 412 files, 5100 tests passed (37 skipped).pnpm run build-with-lint: tsc, eslint, and production bundle succeeded.Checklist
|format:inlinetokens with spaces after commas in the option list will emit those spaces. Compact lists and FIELD/FILE are unchanged.Summary by CodeRabbit
New Features
a,bora, b.Bug Fixes
Documentation