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
@@ -186,15 +186,15 @@ Sequence contains no matching element
186
186
187
187
### Finding the Offending mxunit File
188
188
189
-
Write a Go tool (or use the pattern below) to compare property keys of mxcli-written files against Studio Pro-native files of the same `$Type`:
189
+
Write a Go tool (or use the pattern below) to compare property keys of mxcli-written files against Studio Pro-native files of the same `$type`:
190
190
191
191
```go
192
-
// Walk mprcontents/, group files by $Type, compare key sets
192
+
// Walk mprcontents/, group files by $type, compare key sets
193
193
// Files with EXTRA keys (vs native files of same type) = the crash cause
194
194
// Files with MISSING keys = also crash cause for mx diff
195
195
```
196
196
197
-
The principle: for each `$Type`, ALL instances must have the **exact same set of non-$ property names**. Any deviation → crash.
197
+
The principle: for each `$type`, ALL instances must have the **exact same set of non-$ property names**. Any deviation → crash.
198
198
199
199
### Version-Specific Properties
200
200
@@ -229,7 +229,7 @@ Some properties only exist in certain Mendix versions. Before adding a property
229
229
230
230
**Symptom**: Studio Pro crashes when opening a project with `System.InvalidOperationException: Sequence contains no matching element` at `Mendix.Modeler.Storage.Mpr.MprProperty..ctor`.
231
231
232
-
**Root cause**: A BSON document contains a property (field name) that does not exist in the Mendix type definition for its `$Type`. Studio Pro's `MprProperty` constructor uses `First()` to look up each BSON field in the type cache, and crashes on unrecognized fields.
232
+
**Root cause**: A BSON document contains a property (field name) that does not exist in the Mendix type definition for its `$type`. Studio Pro's `MprProperty` constructor uses `First()` to look up each BSON field in the type cache, and crashes on unrecognized fields.
@@ -272,7 +272,7 @@ for t, props in crash_props.items():
272
272
273
273
3.**Extra properties = the crash cause**. The fix is to remove those fields from the writer function.
274
274
275
-
**Example**: `DomainModels$CrossAssociation` had `ParentConnection` and `ChildConnection` copied from `DomainModels$Association`, but these fields don't exist on `CrossAssociation`. Removing them fixed the crash.
275
+
**Example**: `DomainModels$CrossAssociation` had `ParentConnection` and `ChildConnection` copied from `DomainModels$association`, but these fields don't exist on `CrossAssociation`. Removing them fixed the crash.
276
276
277
277
**Key principle**: When copying serialization code between similar types (e.g., Association → CrossAssociation), always verify which fields belong to each type by checking a baseline project's BSON.
278
278
@@ -282,7 +282,7 @@ for t, props in crash_props.items():
282
282
283
283
**Root cause**: Two variants:
284
284
285
-
1.**Association stored as Attribute**: In `ChangeActionItem` BSON, an association name was written to the `Attribute` field instead of the `Association` field. Check the executor code that builds `MemberChange` — it must query the domain model to distinguish associations from attributes.
285
+
1.**Association stored as Attribute**: In `ChangeActionItem` BSON, an association name was written to the `attribute` field instead of the `association` field. Check the executor code that builds `MemberChange` — it must query the domain model to distinguish associations from attributes.
286
286
287
287
2.**Entity treated as Enumeration**: In `CreateVariableAction` BSON, an entity qualified name was used as `DataTypes$EnumerationType` instead of `DataTypes$ObjectType`. Check `buildDataType()` in the visitor — bare qualified names default to `TypeEnumeration` and need catalog-based disambiguation.
- One property per line (single line acceptable for 1-2 properties)
117
117
118
-
#### Colon `:` vs `AS` — When to Use Each
118
+
#### Colon `:` vs `as` — When to Use Each
119
119
120
120
Use **colon** for property definitions (assigning a value to a named property):
121
121
122
122
```mdl
123
-
CREATE ENTITY Shop.Product (
124
-
Name: String(200), -- property: type/value
125
-
Price: Decimal,
123
+
create entity Shop.Product (
124
+
Name: string(200), -- property: type/value
125
+
Price: decimal,
126
126
);
127
-
TEXTBOX txtName (Label: 'Name', Attribute: Title)
127
+
textbox txtName (label: 'Name', attribute: title)
128
128
```
129
129
130
-
Use **`AS`** for name-to-name mappings (renaming, aliasing, mapping one name to another):
130
+
Use **`as`** for name-to-name mappings (renaming, aliasing, mapping one name to another):
131
131
132
132
```mdl
133
-
CUSTOM NAME MAP (
134
-
'kvkNummer' AS 'ChamberOfCommerceNumber', -- old name AS new name
135
-
'naam' AS 'CompanyName',
133
+
CUSTOM NAME map (
134
+
'kvkNummer' as 'ChamberOfCommerceNumber', -- old name AS new name
135
+
'naam' as 'CompanyName',
136
136
)
137
-
ALTER ENTITY Shop.Product RENAME Code AS ProductCode -- old attr AS new attr
137
+
alter entity Shop.Product rename Code as ProductCode -- old attr AS new attr
138
138
```
139
139
140
-
**Rule of thumb**: if the left side is a *fixed property key* defined by the syntax, use `:`. If the left side is a *user-provided name* being mapped to another name, use `AS`.
140
+
**Rule of thumb**: if the left side is a *fixed property key* defined by the syntax, use `:`. If the left side is a *user-provided name* being mapped to another name, use `as`.
141
141
142
142
### Step 5: Validate
143
143
@@ -147,31 +147,31 @@ Run these checks before finalizing syntax design:
147
147
2.**LLM generation test** — Give one example to an LLM, ask for a variant. Does it get it right?
148
148
3.**Diff test** — Change one property. Is the diff exactly one line?
149
149
4.**Pattern test** — Does it follow CREATE/ALTER/DROP/SHOW/DESCRIBE? If not, why?
150
-
5.**Roundtrip test** — Can `DESCRIBE` output be fed back as input?
150
+
5.**Roundtrip test** — Can `describe` output be fed back as input?
0 commit comments