Skip to content

shell/syntax: fix $() command substitution end column - #818

Merged
ewhauser merged 2 commits into
mainfrom
ewhauser/cmdsubst-end-column
Mar 31, 2026
Merged

ewhauser merged 2 commits into
mainfrom
ewhauser/cmdsubst-end-column

Conversation

@ewhauser

Copy link
Copy Markdown
Owner

Summary

  • adjust $() command-substitution span reporting so downstream linters get the expected end column
  • keep the underlying end offset exact so source slicing still returns only the command substitution text
  • add a regression test that locks the $() span behavior in place

Root cause

CmdSubst.End() was reporting a display column that was one short for $() substitutions in large-corpus parity cases. That surfaced as exact location mismatches in downstream lint diagnostics even though the parsed node and sliced source text were otherwise correct.

Validation

  • go test ./shell/syntax -count=1
  • go test ./... -run '^$'

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b0602b457

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread shell/syntax/nodes.go Resolved
@ewhauser
ewhauser merged commit 43e24a8 into main Mar 31, 2026
16 checks passed
@ewhauser
ewhauser deleted the ewhauser/cmdsubst-end-column branch March 31, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant