Repository navigation
fix(cli): keep column comments in reylo play's types - #143
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
ℹ️ No critical issues. One rough edge inline.
Reviewed changes
This review covers the fix that teaches src/type-format.ts to read the field doc comments src/module-types.ts writes, so playResult no longer catches a parse error and shows unknown.
- Tokenizer and tree: a
/** … */is now one token, and each object member keeps it asdocwith its lines re-indented to*. - Printers:
flatwrites the comment inline throughoneLineDoc. At any finite width,printbreaks an object that has a documented field and puts each comment on the lines before its field. - Tests: the new
tests/type-format.test.tscovers a one-line comment with an escaped*\/, a multi-line comment, a comment nested in a union,Infinitywidth, and types without comments. These pass, andtsc --noEmit --runExternalCodeis clean.
claude-opus-5-5 | 𝕏
Contributor
There was a problem hiding this comment.
✅ No new issues found. The earlier finding is fixed.
Reviewed changes
This review covers the one commit pushed since the last Pullfrog review.
oneLineDocblank lines: changed the regex to/(?:\n[ \t]*\*[ \t]*)+/g, which turns each run of comment line breaks into one space. A paragraph break written as a bare*no longer leaves a stray*in theInfinity-width output. This also holds when the blank line comes just before*/.- Test: added a two-paragraph comment to the no-width test, which expects
/** para one para two */. All three tests intests/type-format.test.tspass.
claude-opus-5-5 | 𝕏
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.

A column with a
COMMENTmade every query that reads it showunknowninreylo playand the playground's API: the row type a statement's module declares carries the comment as a doc comment before its field, and the formatter that breaks types over lines could not read one.The formatter now reads a doc comment as part of the field after it. Broken over lines, each comment stays on the lines before its field, as TypeScript reads it; on one line (no width), it is written inline.
src/type-format.ts: doc comments in the tokenizer, the tree and both printerstests/type-format.test.ts: one-line and multi-line comments, nested in a union, and with no width