Repository navigation
Send only the cursor's statement under #delimit ;, and run the release build's tests the way CI does - #420
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 29 minutes. View limit details
|
jbearak
force-pushed
the
t3/send-delimit-statement-and-release-tests
branch
from
November 19, 2026 14:50
1eceeb6 to
b15dc15
Compare
… its first or last line With display on one line and 1; clear; on the next, Send Statement on display also ran clear;, and the same held for }; clear; after a block and for code before a statement on its first line. The detector now reads each ; statement's character range and sends the statements that start on the cursor's line (or the one through it), cutting the lines they share. When the last line holds the next statement, the cursor stays there. Send Upward and Downward Lines end and start at the same cuts. Co-authored-by: Claude Opus 5.5 <[email protected]>
…e pinned Bun release-build.yml ran bun test ./tests in one process, which on Bun 1.3.13 can hang or throw EBADF unless helper-pty.test.ts runs on its own (#380). Both workflows now run bun run test:ci, a package.json script that does that split, and a test checks they still match. Co-authored-by: Claude Opus 5.5 <[email protected]>
Each send lexed and parsed the whole document, which took about 130 ms on a 50,000-line file even to send a selection. The reading is now kept per document until its version changes. Co-authored-by: Claude Opus 5.5 <[email protected]>
jbearak
force-pushed
the
t3/send-delimit-statement-and-release-tests
branch
from
November 19, 2026 14:53
b15dc15 to
66fbfd8
Compare
jbearak
added a commit
that referenced
this pull request
Nov 19, 2026
… or repeats code, and send input from a data line as its whole block (#424) * Send whole lines again under #delimit ; so Send Statement never skips or repeats code, and send input from a data line as its whole block #420 cut #delimit ; lines at statement boundaries by character. That skipped a one-line if/else chain sharing lines with other statements, sent a command twice when a block comment after its ; ended on the next line (and cut the comment in Send Upward Lines), sent a lone input data row, and took seconds on a large block because widening searched every statement for each block edge. Sends take whole lines again, as before #420, with one cut: a line that ends a statement begun above it and then holds whole statements of its own (display / 1; clear;). A send from above ends at that statement's ; and leaves the cursor on the line; Send Statement there sends the rest. A * comment whose ; is on a later line counts as such a statement. Anything else, such as a closer, a header, or a comment ending on the line, keeps the line whole. Fixed in the whole-line code too: a block's closer line that continues onto the next line (}; di ///) now takes that line, and a line holding one block's closer and another's header takes both blocks. Every line of input through its end now sends the whole block. A property test steps through generated #delimit ; and cr documents and checks that the sends, lexed one by one, add up to the document's tokens: each statement once, in order, no comment or string cut. Co-authored-by: Claude Opus 5.5 <[email protected]> * Don't cut a line after a statement whose comment line, not its code, starts above it With // note on one line and di 1; di 2; on the next, Send Statement on the second line sent only di 2;, since the statement di 1; counted as begun at its comment. A cut now needs the statement's code to start on an earlier line. The step-through property also generates a comment line before a statement and a cr program whose body switches to #delimit ;. Co-authored-by: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Under
#delimit ;, Send Statement could run a neighbouring statement the user didn't ask for. Withdisplayon one line and1; clear;on the next, Send Statement ondisplayalso ranclear;. v0.15.1 didn't. Separately, the release build ran its tests in one process, which can hang or throw EBADF on the Bun version CI pins. This is part 1 of 2 from a review ofv0.15.1..mainbefore a stable release. Part 2 covers the Data Browser, the CLI, and the Stata pane.1. Send Statement under
#delimit ;The detector worked in whole lines, so it sent every statement on the first and last lines of the cursor's statement. It now reads each
;statement's character range. Send Statement sends the statements that start on the cursor's line, or the one passing through it if the line starts none, and cuts the lines it shares with other statements:display/1; clear;, cursor ondisplay: sendsdisplay/1;. The cursor stays on line 2, so the next Send Statement sendsclear;. Stepping through runs each statement once.foreach v in a b {;…}; clear;, cursor on the header: sends the block through};. On the closer line, it sendsclear;. A};with nothing after it still sends the block.clear; display/1;, cursor on1;: sendsdisplay/1;, notclear;.di 1; di 2;), for a comment after the last;, or for#delimit crcode.;statements, so neither splits a statement or a block (Send Upward and Downward Lines no longer cut a block in half #377).docs/send-to-stata.mddescribes this. Decision for review: a block's closer starts no statement, so on}; clear;Send Statement sendsclear;, not the block. Without that, stepping from the header would run the block twice.2. Release build tests
release-build.ymlranbun test ./testsin one process.ci.ymlexplains whyhelper-pty.test.tshas to run on its own on Bun 1.3.13 (#380). Both workflows now runbun run test:ci, a new package.json script that splits the run as CI did, includingsrc/providers/__tests__. A test checks that the two workflows run the same command.bun test ./testsstill works locally, and DEVELOPMENT.md mentionstest:ci. PR checks don't runrelease-build.yml, so this step runs for real only on the next release.9. Faster sends on long files
Each send lexed and parsed the whole document, about 130 ms on a 50,000-line file even to send a selection. The reading is now cached per document version, so later sends from the same version take under 0.1 ms.
Proof: 16 cases in
tests/unit/send-to-stata/semicolon-shared-lines.test.tsfail on main. One is a property test, which fails on main with a counterexample: for random layouts ofdi N;statements across lines, each line sends exactly the statements it starts, or else the one through it. A second property checks that stepping runs each statement once. The workflow test inbinary-command-name.test.tsand the cache test incode-to-send.test.tsalso fail on main.check:line-endings,typecheck,bun test ./tests(10,029 pass, 0 fail),lintandbun run test:cieach pass when run separately on this branch.bun run packagebuilds the extension.Created with Claude Opus 5.5 in Claude Code.