Skip to content

TraceOps findings: page/grammar/combobox fixes (#9,#10,#11,#12,#16,#17,#23,#27) - #809

Merged
ako merged 4 commits into
mendixlabs:mainfrom
ako:claude/mxbuild-diagnostics-spike-emta6h
Jul 31, 2026
Merged

TraceOps findings: page/grammar/combobox fixes (#9,#10,#11,#12,#16,#17,#23,#27)#809
ako merged 4 commits into
mendixlabs:mainfrom
ako:claude/mxbuild-diagnostics-spike-emta6h

Conversation

@ako

@ako ako commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Fixes eight TraceOps findings verified against mxbuild 11.12.1 (mx check → 0 errors). Each ships with regression tests and a mdl-examples/bug-tests/ repro.

Pages

Widgets

Grammar

Not defects (documented, no code change)

claude added 4 commits July 30, 2026 15:12
…ze (TraceOps #9/#10/#17)

Three page-builder defects found by the TraceOps project, each verified against
mxbuild 11.12.1 (`mx check` → 0 errors after the fix):

#9 — `dynamictext x (Content: '')` persisted as `Content: '{1}'` with no
parameters (an orphaned placeholder) → CE0720 "Place holder index 1 is greater
than 0". buildDynamicTextV3 unconditionally defaulted empty content to `{1}`.
Now empty content with no params is a literal empty template; `{1}` is only
synthesized when a parameter exists.

#10 — `dynamictext s (Content: '$318')` was treated as a variable reference and
became an unbound `{1}` param → CE0402/CE1613 ("attribute '$318' no longer
exists"). A `$` starts a variable ONLY when followed by a letter/underscore
(new isDynamicTextVariableRef / dynamicTextVariableRe); `$318` stays literal.

#17 — `listview (… PageSize: 200)` always paged at 20: the property parsed into
the AST but was ignored on write (buildListViewV3 hardcoded 20) and never read
or emitted by describe. Now the write honors GetIntProp("PageSize"), the
describe parse reads it, and the listview formatter emits a non-default value so
it round-trips.

Tests: TestBuildDynamicTextV3_{EmptyContent,DollarDigitLiteral,VariableStillBinds},
TestIsDynamicTextVariableRef, TestBuildListViewV3_PageSize. Repro
mdl-examples/bug-tests/traceops-9-10-17-dynamictext-listview.mdl. Symptom rows
added to fix-issue.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
…ribute clauses (TraceOps #27)

A `/** … */` doc comment written between two `alter entity … add attribute`
clauses (before the ADD keyword) was a parse error ("no viable alternative at
input '/**'"): alterEntityAction accepted a doc comment only INSIDE an
attributeDefinition. `--` line comments are not an equivalent workaround — they
are discarded by the lexer, whereas a `/** */` doc comment is persisted as the
attribute's Mendix documentation, so rewriting to `--` silently drops the
documentation the author meant to store.

alterEntityAction now accepts an optional leading docComment on ADD ATTRIBUTE /
ADD COLUMN, and ExitAlterEntityAction attaches it as the added attribute's
documentation when the attributeDefinition itself has none. Verified against
mxbuild 11.12.1: the script builds clean and DESCRIBE ENTITY round-trips the doc
comment on the second column.

`make grammar` regenerates the parser (generated files are not committed).
Test TestAlterEntityAddAttributeDocComment; repro
mdl-examples/bug-tests/traceops-27-doc-comment-between-clauses.mdl.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
…ete association combobox (TraceOps #23)

A `combobox (Association: Mod.Ref, …)` was accepted by the parser but the widget
engine read the reference only from the `attribute:` keyword, so the explicit
`Association:` keyword was silently dropped and the widget fell back to
enumeration mode → MxBuild failed CE0642 ("Property 'Attribute' is required").

Two changes:
 1. The engine's `Association` source now reads the reference from EITHER
    `Association:` or the generic `attribute:` keyword, so the intuitive
    `Association:` form works. Verified on mxbuild 11.12.1: a complete
    association combobox (reference + datasource + CaptionAttribute) builds with
    0 errors.
 2. New MDL-WIDGET16 flags an incomplete association combobox — an `Association:`
    with no `datasource:` (the option list) — at check time with the full
    working syntax, instead of letting it pass check and fail MxBuild with the
    opaque CE0642.

Association mode needs three things: the reference (`Association:`/`attribute:`),
the option list (`datasource:` = target entity), and the display value
(`CaptionAttribute:`). Doc updated. Test TestValidateComboBoxAssociation; repro
mdl-examples/bug-tests/traceops-23-combobox-association.mdl.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
…ibute-keyword hint (TraceOps #11/#12/#16)

Three MDL ergonomics improvements, each verified against mxbuild 11.12.1
(`mx check` → 0 errors):

#11 — a single-quoted string literal may now span multiple lines. STRING_LITERAL
excluded `\r\n`, so a newline terminated the token ("missing END at …"). Dropped
the newline exclusion; mxbuild accepts a multi-line String value. (A missing
close-quote now spans lines — the standard multi-line-string trade-off.)

#12 — a bare MDL keyword (`body`, `content`, `search`, `as`, …) may be used
unquoted as a WIDGET name, matching attribute and placeholder names. The
widgetV3 rule accepted only IDENTIFIER | QUOTED_IDENTIFIER; it now also accepts
`keyword`, and the visitor reads `wCtx.Keyword()` so the name is preserved
(previously the parse failed, or an accepted keyword name came out empty →
CE7247 "name cannot be empty").

#16 — `alter entity … add <name>: <type>` without the `attribute` keyword gave
an opaque "no viable alternative at input 'add<Name>'". enhanceErrorMessage now
appends an actionable hint with the correct `add attribute <name>: <type>` form
when the offending line is `add <word>:` and `<word>` isn't a real clause
keyword (attribute/column/index/event/value/…); gated to the primary error.

`make grammar` regenerates the parser (generated files are not committed). Tests
TestMultiLineStringLiteral, TestKeywordWidgetName,
TestAlterEntityMissingAttributeKeywordHint; repro
mdl-examples/bug-tests/traceops-11-12-16-strings-names.mdl.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
@ako
ako merged commit d9e9dce into mendixlabs:main Jul 31, 2026
2 checks passed
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