Skip to content

Schema.Editor can't generate C++: a schema with a cpp code generator fails in the editor though kschema generate succeeds #279

Closed

Description

@matt-edmondson

What's wrong

By default SchemaGenerator registers only the C# generator (Schema/Generation/SchemaGenerator.cs:21-25). The C++ generator is available only to a host that calls SchemaGenerator.Register(new CppCodeGenerator(...)), and the only host that does is Schema.Tool/Program.cs:51.

  • Schema.Editor/Schema.Editor.csproj references only ..\Schema\Schema.csproj, not Schema.Cpp, and nothing in Schema.Editor/ calls Register.
  • Schema.Editor/CodeGeneratorPanel.cs (ShowLanguageSelector) builds its list from SchemaGenerator.SupportedLanguages, so the only language offered is csharp.

Scenario

  1. Write a schema with a code generator set to "language": "cpp".
  2. Run kschema generate my.schema.json: the headers are written.
  3. Open the same schema in Schema.Editor and press Generate. The editor reports: "No generator is registered for language 'cpp'. Known languages: csharp."

The C++ generator is a first-class part of the repository, with its own project, package and acceptance tests, but the editor can't use it. The editor targets net10.0, which Schema.Cpp already targets, so nothing prevents the reference.

Suggested fix

  • Reference Schema.Cpp from Schema.Editor and call SchemaGenerator.Register(new CppCodeGenerator(options)) at startup, as Schema.Tool does.
  • CppGeneratorOptions currently reaches the tool only through --cpp-options <file>. The editor needs a per-generator options-file path, or at least default options. With defaults, unsupported types such as vectors and handles are refused by name, which is already reported cleanly as TargetCannotExpress.
  • Add a UI test that the language picker lists cpp, and that Generate succeeds for a schema that uses only standard types.

Activity

  1. matt-edmondson commented on Oct 17, 2026

    @matt-edmondson
    ContributorAuthor

    Triage

    • Category: Improvement (parity between the editor and the CLI)
    • Priority: Medium. A first-class generator is unreachable from the editor, though the CLI works.
    • Area / suggested assignment: Schema.Editor startup / CodeGeneratorPanel; Schema.Cpp.
    • Duplicates / in progress: None found. Bump ktsu.ImGui.NodeEditor from 3.38.5 to 3.75.1 #277 (NodeEditor bump) is unrelated.
    • Next step: Reference Schema.Cpp and register CppCodeGenerator at editor startup, with default options. A per-generator options path can come later.

    Generated by Claude Code

  2. added a commit that references this issue on Oct 20, 2026
    978e31f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions