Repository navigation
Cascade class and enum renames through wrappers and function signatures - #315
Merged
Merged
Conversation
TryRenameClass and TryRenameEnum walked member types and arrays only, so a reference inside Optional, Handle, Result, Span or Vector, or in an interface function's return or parameter types, was left naming the old type. The walk now covers every type reference in the schema, and renaming the error enum also repoints Schema.ErrorType. Closes #222 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017diBTKdccitjf28kU2Syfq
Main also repoints the error type when its enum is renamed; both sides' tests are kept. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9FBXHS37WoAF87LDY2ZVV
The unknown-option check refused every option on validate, so `validate --no-data` failed once both changes reached main. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017diBTKdccitjf28kU2Syfq
|
3 tasks
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.



Requested by Matt · project thread
Before: renaming a class or enum repointed member types and array elements only. A reference inside an
Optional,Handle,Result,SpanorVector, or in an interface function's return type or parameter types, kept the old name, soValidate()reported a dangling reference straight after a successful rename. Renaming the enum named bySchema.ErrorTypeleft that dangling too.After: every type reference in the schema follows a rename, at any nesting depth, including
Array<Optional<…>>and function signatures, and renaming the error enum repointsErrorType.How:
EnumerateMemberTypesnow also yields each interface function's return type and parameter types, andExpandTyperecurses throughWrapperType.ElementTypeandVector.ElementTypeas well asArray.ElementType. Both class and enum renames andRepointArrayKeysuse that walk.SchemaRenameTestsgains five cases covering wrappers, an array of optionals, function signatures, enum references and the error type. All five fail without the change.Closes #222
Generated by Claude Code