Repository navigation
Keep offering a user program's option as more of it is typed, and insert it as Stata accepts it - #394
Merged
Merged
Conversation
…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]>
Contributor
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 4 minutes. View limit details
|
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.
Typing an option at a call to a user program made the suggestions disappear too early. For
syntax [, DETail Level(real 95)],p, deoffered nothing: an option stayed in the list only while the typed text was a prefix of its minimum abbreviation (det). Accepting a suggestion also insertedDETailorLevel()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 fromsyntax_option_spelling(#391).get_completions_for_user_program_callwas a copy of the_with_programvariant and now calls it.Proof: two new tests in
tests/unit/user-program-option-completion.test.tsfail without the fix. Typecheck, lint, andbun test ./testspass (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.