Skip to content

Migrate to carapace-shlex v2 (Span replacing Index)#1259

Draft
rsteube wants to merge 2 commits into
masterfrom
shlex-v2
Draft

Migrate to carapace-shlex v2 (Span replacing Index)#1259
rsteube wants to merge 2 commits into
masterfrom
shlex-v2

Conversation

@rsteube

@rsteube rsteube commented Jun 30, 2026

Copy link
Copy Markdown
Member

Update action.go to use Token.Span.Start instead of the removed
Token.Index field. Add replace directive pointing to local
carapace-shlex with v2 API. All tests pass.

Assisted-by: Crush:glm-5.2

rsteube added 2 commits June 30, 2026 20:25
Update action.go to use Token.Span.Start instead of the removed
Token.Index field. Add replace directive pointing to local
carapace-shlex with v2 API. All tests pass.

Assisted-by: Crush:glm-5.2
Replace manual token chain patterns with SplitForCompletion:

- zsh/action.go: replace 4-regex quoting detection with ctx.QuotingState
  from SplitForCompletion using ZshFormat. Full-quoting state detection
  (FULL_QUOTING_*_STATE) now uses HasPrefix/HasSuffix on RawCurrentWord
  instead of regexes. Remove regexp import.

- bash/patch.go: replace tokens.CurrentPipeline().FilterRedirects().
  Words().Strings() chain with ctx.Words, redirect detection with
  ctx.IsRedirect, WordbreakPrefix() with ctx.Prefix.

- cmd_clink/patch.go: same chain replacement with ctx.Words.

- action.go:split(): use ctx.Words for pipeline args, ctx.QuotingState
  for value quoting, ctx.IsRedirect/ctx.CurrentWord for redirect target.
  Keep Split + pipelineTokens for prefix computation (Span-based prefix
  differs from ctx.Prefix which is wordbreak prefix).

All tests pass.

Assisted-by: Crush:glm-5.2
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