Repository navigation
feat(ts): emit each module in Rust source order - #27
Merged
Merged
Conversation
Quest-Claim: 675dd4e5e8d8f203
…em first Sort each module's items, each class's or companion's methods, and each file's imports by source position, then by instance suffix and the full instance, so the order no longer depends on the order translation reaches them in. A test translates the codec fixture with and without bench::run and checks the first output's lines stay in order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0115AT2ue6x9cT5e5J9SZtCn
Only order changes: every file keeps the same lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0115AT2ue6x9cT5e5J9SZtCn
kixelated
marked this pull request as ready for review
October 24, 2026 12:45
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Regenerated the lang harness.ts snapshot in source order; no logic change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0115AT2ue6x9cT5e5J9SZtCn
Collaborator
Author
|
This emits each module's items in Rust source order. A test proves that adding a root keeps the existing items' relative order, and the snapshots were regenerated in their own commit as a pure reorder.
Merging. (written by Opus 5.5) |
kixelated
added a commit
that referenced
this pull request
Oct 24, 2026
Keeps both sides: iterators (#23) beside drops and async, `!` values through a never-assigned temp (#28), and source order (#27), whose `order` now takes a span so a hoisted generator sorts where its async body is written. An iterator that owns a value that drops is refused, since an `rt.Iter` drops nothing it skips, consumes, or holds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0115AT2ue6x9cT5e5J9SZtCn
This was referenced Oct 24, 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.
Problem
rust2-ts printed a class's or companion's methods, the instances of a generic item, and each file's imports in the order translation reached them. Adding a root (
bench::runin #7) reordereddecode.tswith no change in behaviour, so any new root churned unrelated output.Approach
Program::namesorts module items and each owner's methods by it, and names collisions in that order.Pairinfmt$Pair), then by their full type arguments, which tells apart instances whose suffixes match (such as two closures). Documented ints/README.md.source_ordertest: translates the codec fixture with onlyharness::run, then withbench::runadded as the first root, and asserts every line of the first output stays in order in the second (imports split one name per line). It fails onmain.Impact
MIGRATE.mdentry.Alternatives
Follow-ups
foo; once a root reaches a second instance, the first becomesfoo$u8, and that changes code the new root never reaches. Numbered$2suffixes can shift the same way. This needs a naming decision (for example, always suffix generic instances), so it should be its own quest.ts/snapshots and need to regenerate them after this merges.Closes the quest
quest/m2/ts-source-order.md.(written by Opus 5.5)
🤖 Generated with Claude Code
https://claude.ai/code/session_0115AT2ue6x9cT5e5J9SZtCn