Repository navigation
Edit semantic types in the editor, and rename them and interfaces with their references - #316
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
…h their references Adds TryRenameSemanticType and TryRenameInterface, which carry the new name to every member, parameter, return type and refining semantic type naming the old one, plus RestoreSemanticType and RestoreInterface for undo. The editor gains a Semantic Types tree tab with undoable add, rename and delete, and a properties panel for the name, description and underlying type. Diagnostics on a semantic type now navigate to it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017diBTKdccitjf28kU2Syfq
The semantic type tree's add, rename and delete paths, the diagnostics panel's jump to a semantic type, renaming through arrays and vectors, refusing another schema's element, and RestoreInterface were new and untested. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YNKVuFTzTt8TiFb94MS4eW
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
Keeps both sides' rename tests. 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
SchemaEditor reached the CA1506 coupling limit once the panel's popups, commands and types were counted against it, so the panel follows CodeGeneratorPanel into a class of its own. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017diBTKdccitjf28kU2Syfq
A plain dictionary written from two threads at once can lose a write, which showed up as a parallel test finding its freshly registered language missing. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017diBTKdccitjf28kU2Syfq
The two data rows registered the same language and ran in parallel, so one row's generator could replace the other's between registering and generating. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017diBTKdccitjf28kU2Syfq
|
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: the editor could open a schema containing semantic types and do nothing with them. They had no tree, no panel, and a diagnostic on one led nowhere. The model also had no rename for a semantic type or an interface, so renaming either meant editing every reference by hand.
After: a Semantic Types tab lists them, with undoable add, rename and delete. Selecting one opens a panel for its name, description and underlying type. The type is chosen from the same picker members use, and every change is undoable. Renaming a semantic type or an interface updates every member, parameter, return type and refining semantic type that names it. Diagnostics on a semantic type now jump to it.
How:
Schema.TryRenameSemanticTypeandTryRenameInterfacefollow the cascade thatTryRenameClass/TryRenameEnumalready use, and the type walk now includes semantic types' underlying types.RestoreSemanticType/RestoreInterfacemake deletes undoable. The editor side isTreeSemanticType,ShowSemanticTypePropertiesand aNavigateTocase. Tests: five rename tests inSchemaRenameTests, andSemanticTypePanelTestsfor the panel and tree. All 554 unit tests and 208 UI tests pass.Not included yet: an editor for interfaces, and editing a semantic type's six metadata properties, because the metadata panel is written against members. Both stay open on #284.
This branch is stacked on #315 (the class and enum rename cascade). Its first commit is that PR's, so review #315 first.
Part of #284
Generated by Claude Code