Fix Swift helper indentation and PHP header comment grammar#2930
Merged
Conversation
The multiline templates in SwiftRenderer emitted indentation level L as 2L-1 tabs, so generated helper code (JSONNull, JSONCodingKey, JSONAny, the date-decoding strategy, and the Alamofire extension) rendered method bodies at 12 spaces inside 4-space-indented declarations. Halve the leading tab runs so every level is one tab and the generated Swift is uniformly 4-space indented. Also fix "This is a autogenerated file" -> "an" in the PHP file header. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Two cosmetic fixes to generated output, found while testing
25.0.0-pre1.Swift: generated helpers were misindented
The multiline templates in
SwiftRenderer.tsencoded indentation level L as 2L−1 leading tabs, so all the emitted helper code —JSONNull,JSONCodingKey,JSONAny, the customdateDecodingStrategy, and the Alamofire extension — rendered method bodies at 12 spaces inside 4-space-indented declarations:This PR halves the leading tab runs (every run in the file was odd-length, so the mapping is exact), making the generated Swift uniformly 4-space indented:
The change is whitespace-only: 169 template lines in
SwiftRenderer.ts, no logic touched.PHP: header comment grammar
// This is a autogenerated file:→// This is an autogenerated file:Testing
npm run buildclean,npm run test:unitpasses (71/71).JSONNull,JSONAny,JSONCodingKey, and the date decoder is uniformly indented, and that the PHP header renders correctly.Unrelated nit noticed while testing, not fixable in a PR: the npm
nextdist-tag for thequicktypepackage still points at 9.0.13 — probably worth annpm dist-tag rm quicktype next.🤖 Generated with Claude Code