Repository navigation
Show a syntax option's real minimum abbreviation in hover, completion, and sight parse --json - #391
Merged
Merged
Conversation
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 30 minutes. View limit details
|
…arse --json The parser took one letter as a syntax option's minimum abbreviation: `D` for Detail, `c` for cache, `C` for noCONStant. In StataMP 18 the minimum is the leading capitals in lowercase (`d`, `nolo` for NOLOg, `cache` for CACHE), after the `no` of noCONStant (`nocons`); without leading capitals the whole name as written (`cache`, `myOption`). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…inimum Co-Authored-By: Claude Opus 5.5 <[email protected]>
jbearak
force-pushed
the
fix/syntax-option-min-abbreviation
branch
from
November 5, 2026 21:07
7f4c983 to
9a6e44e
Compare
…'s mid-name capitals StataMP 18 lowercases only a syntax option's leading capitals: MyOption is typed `m` … `myOption`, not `myoption`, and noABc(string) is typed `noABc`, since only an option without an argument is negatable. syntax_option_spelling now gives an option's full spelling, minimum, and local, and both the parser and macro-write matching read the minimum from it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 5, 2026
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.
Hover and
sight parse --jsongave asyntaxoption's minimum abbreviation as a single letter:DforDetail,cforcache,CfornoCONStant. Those spellings are wrong, and forcacheandnoCONStantStata rejects them.The parser now follows StataMP 18. Stata lowercases only the leading capitals, and keeps the rest of the name as written:
Detail→d,NOLOg→nolo,CACHE→cache,MyOption→m(typed up tomyOption, nevermyoption);no, thenoplus the capitals after it:noCONStant→nocons(noconis rejected);cache,myOPTion, andnoABc(string). An option with an argument is never negatable.syntax_option_spelling(new,src/utils/syntax-option-name.ts) holds this rule. The parser andcommand_macro_writes(#390) both read it, which replaces their separate copies.Completion widened clashing abbreviations without checking these minimums. With
syntax [, cache capture]it offeredcafor both options, and showed no completions oncecacwas typed. It now never goes below an option's minimum (found in review).Decision:
schema_versionforparse --jsonstays at 1.min_abbreviationstill means the minimum abbreviation; it was wrong before.docs/cli.mdnow defines it. The golden file changesD→dandL→l.Proof: every rule above probed on StataMP 18;
tests/unit/syntax-option-name.test.tschecks the probed cases. New tests intests/unit/syntax-option-parsing.test.tsandtests/unit/user-program-option-completion.test.tsfail without the fix. Typecheck, lint, andbun test ./testspass.Follow-up, not changed here:
syntax [, saveAs(string)]defines the localsaveAs, butsyntax_option_local_namestill lowercases it tosaveas.Reviewed with sol-loop: 3 rounds with gpt-6.1-sol. Sol verdict: approved
Created with Claude Opus 5.5 in T3 Code.