Skip to content

Keep offering a user program's option as more of it is typed, and insert it as Stata accepts it - #394

Merged
jbearak merged 1 commit into
mainfrom
fix/user-program-option-completion
Nov 5, 2026
Merged

jbearak merged 1 commit into
mainfrom
fix/user-program-option-completion

Conversation

@jbearak

@jbearak jbearak commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Typing an option at a call to a user program made the suggestions disappear too early. For syntax [, DETail Level(real 95)], p, de offered nothing: an option stayed in the list only while the typed text was a prefix of its minimum abbreviation (det). Accepting a suggestion also inserted DETail or Level() as declared, and StataMP 18 rejects both, because options must be typed in lowercase.

Options now match while the typed text begins their full spelling (d … detail), and they insert as Stata takes them: detail, level(). The label still shows the declared name, whose capitals mark the abbreviation. The spelling comes from syntax_option_spelling (#391). get_completions_for_user_program_call was a copy of the _with_program variant and now calls it.

Proof: two new tests in tests/unit/user-program-option-completion.test.ts fail without the fix. Typecheck, lint, and bun test ./tests pass (9674 tests).

Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved

Created with Claude Opus 5.5 in T3 Code.

…ert it as Stata accepts it

Option completion at a call to a user program kept an option only
while the typed text was a prefix of its minimum abbreviation, so
`p, de` offered nothing for `syntax [, DETail]`. And it inserted the
option as declared, `DETail` or `Level()`, which StataMP 18 rejects.
Options now match while the typed text begins their full spelling and
insert as `detail` and `level()`. The label still shows the declared
name, whose capitals mark the abbreviation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 65 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 296dabb3-729d-4ca8-8275-d52e8fbb4e08
Commits

Reviewing files that changed from the base of the PR and between 13ad965 and 1035e60.

Files selected for processing: 2

  • src/providers/completion.ts
  • tests/unit/user-program-option-completion.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@jbearak
jbearak merged commit d26970b into main Nov 5, 2026
16 checks passed
@jbearak
jbearak deleted the fix/user-program-option-completion branch November 5, 2026 21:45
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