Skip to content

Edit semantic types in the editor, and rename them and interfaces with their references - #316

Merged
matt-edmondson merged 9 commits into
mainfrom
claude/project-thread-kk9on7-284
Oct 22, 2026
Merged

matt-edmondson merged 9 commits into
mainfrom
claude/project-thread-kk9on7-284

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

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.TryRenameSemanticType and TryRenameInterface follow the cascade that TryRenameClass/TryRenameEnum already use, and the type walk now includes semantic types' underlying types. RestoreSemanticType/RestoreInterface make deletes undoable. The editor side is TreeSemanticType, ShowSemanticTypeProperties and a NavigateTo case. Tests: five rename tests in SchemaRenameTests, and SemanticTypePanelTests for 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

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
@matt-edmondson matt-edmondson self-assigned this Oct 20, 2026
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
@sonarqubecloud

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit 33d97d6 into main Oct 22, 2026
16 checks passed
@matt-edmondson
matt-edmondson deleted the claude/project-thread-kk9on7-284 branch October 22, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants