You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Editor can't create enums, fields, namespaces, source files, aliases, assertions, constructions or float/long literals, though the schema accepts them #383
The graph editor creates new nodes from exactly two sources:
AstNodeCatalog.Templates (Coder.Graph/AstNodeCatalog.cs L57-L96). This feeds the palette, the link-drop menu (CreatableFrom) and "Convert to" (ConversionsFor) in AstGraphEditor.
AstSchema.CreateDefaultChild (AstSchema.cs L648-L660). This backs the "one more child" action and only ever produces a Parameter, a ReturnStatement, a FunctionDeclaration, an EnumMember or an unfilled string literal.
The catalog's nodes are Class, Function, Parameter, Property, Variable, Constant, Entry point, Return, Expression statement, the assignment, binary and unary operators, Variable reference, Call and Conditional. Its only literals are string, int, double and bool.
AstSchema was deliberately widened to accept and wire more node kinds. A loaded document displays and connects them, but nothing in the editor can create one:
AstSchema.Accepts lets a Members slot take FieldDeclaration, EnumDeclaration, NamespaceDeclaration, UsingAlias and CompileTimeAssertion (L702-L705). None of them is in the catalog, and the default Member child is always a FunctionDeclaration.
SlotsOf gives SourceFile and NamespaceDeclaration Members slots, and gives ConstructionExpression an element slot that takes MemberInitialiser. None of those node types can be created either.
LiteralExpression.StorageTypes includes long and float, and every generator emits them (f, LL and so on). The palette can only make int and double literals.
Concrete failure
A user starting from an empty document can't add a field to a class, an enum, or a namespace. "Add member" gives a function, and the palette and link-drop menu have no template for any of these kinds. The same goes for building a header-style document (SourceFile → NamespaceDeclaration → …).
Writing new Point { x = 1 } is impossible because neither ConstructionExpression nor MemberInitialiser can be created.
A float local can't be given a literal of its own type. In Rust, for example, a Decimal (double) literal assigned to an f32 is a type error.
These features only work today in documents that were hand-written in YAML.
Suggested fix / acceptance criteria
Add catalog templates for EnumDeclaration, FieldDeclaration, NamespaceDeclaration, SourceFile, UsingAlias, CompileTimeAssertion, ConstructionExpression and MemberInitialiser. Each should be valid on its own, as the existing templates are, using AstSchema.Unfilled() for operands.
Add Long and Single literal templates, or let the Number and Decimal templates choose a width.
Add a coverage test next to AstNodeCoverageTests that checks:
every AstSlotKind that SlotsOf exposes is satisfiable by at least one catalog template or by CreateDefaultChild;
every type named in Accepts(Member) can be built by some template, apart from an explicit exemption list.
A slot that no menu can fill would then fail the build instead of going unnoticed.
Category: Feature Request. The editor can't create node kinds the schema already accepts.
Priority: Medium. Enums, fields, namespaces, construction expressions and long/float literals can only be added by hand-writing YAML. Generation is unaffected.
Area:Coder.Graph (AstNodeCatalog.Templates, AstSchema.CreateDefaultChild), AstGraphEditor, plus a coverage test next to AstNodeCoverageTests.
Activity
matt-edmondson commentedon Oct 30, 2026
Triage
long/floatliterals can only be added by hand-writing YAML. Generation is unaffected.Coder.Graph(AstNodeCatalog.Templates,AstSchema.CreateDefaultChild),AstGraphEditor, plus a coverage test next toAstNodeCoverageTests.Generated by Claude Code