preserve order of struct in autocomplete (#4018)

fix #3110 preserve order of struct in autocomplete

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2024-09-27 18:23:46 -07:00
committed by GitHub
parent e50de134b1
commit 37bb696a30
24 changed files with 253670 additions and 253668 deletions

File diff suppressed because it is too large Load Diff

View File

@ -22,8 +22,8 @@ Angles and radius with an optional tag.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `angleEnd` |`number` (`double`)| The end angle. | No |
| `angleStart` |`number` (`double`)| The start angle. | No |
| `angleEnd` |`number` (`double`)| The end angle. | No |
| `radius` |`number` (`double`)| The radius. | No |
@ -41,8 +41,8 @@ Center, to and radius with an optional tag.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `center` |`array`| The center. | No |
| `radius` |`number` (`double`)| The radius. | No |
| `to` |`array`| The to point. | No |
| `radius` |`number` (`double`)| The radius. | No |
----

View File

@ -16,8 +16,8 @@ Data to draw a bezier curve.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `to` |`array`| The to point. | No |
| `control1` |`array`| The first control point. | No |
| `control2` |`array`| The second control point. | No |
| `to` |`array`| The to point. | No |

View File

@ -16,9 +16,9 @@ Data for a circular pattern on a 2D sketch.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `arcDegrees` |`number` (`double`)| The arc angle (in degrees) to place the repetitions. Must be greater than 0. | No |
| `center` |`array`| The center about which to make the pattern. This is a 2D vector. | No |
| `repetitions` |`integer` (`uint32`)| The number of repetitions. Must be greater than 0. This excludes the original entity. For example, if &#x60;repetitions&#x60; is 1, the original entity will be copied once. | No |
| `center` |`array`| The center about which to make the pattern. This is a 2D vector. | No |
| `arcDegrees` |`number` (`double`)| The arc angle (in degrees) to place the repetitions. Must be greater than 0. | No |
| `rotateDuplicates` |`boolean`| Whether or not to rotate the duplicates as they are copied. | No |

View File

@ -16,10 +16,10 @@ Data for a circular pattern on a 3D model.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `arcDegrees` |`number` (`double`)| The arc angle (in degrees) to place the repetitions. Must be greater than 0. | No |
| `repetitions` |`integer` (`uint32`)| The number of repetitions. Must be greater than 0. This excludes the original entity. For example, if &#x60;repetitions&#x60; is 1, the original entity will be copied once. | No |
| `axis` |`array`| The axis around which to make the pattern. This is a 3D vector. | No |
| `center` |`array`| The center about which to make the pattern. This is a 3D vector. | No |
| `repetitions` |`integer` (`uint32`)| The number of repetitions. Must be greater than 0. This excludes the original entity. For example, if &#x60;repetitions&#x60; is 1, the original entity will be copied once. | No |
| `arcDegrees` |`number` (`double`)| The arc angle (in degrees) to place the repetitions. Must be greater than 0. | No |
| `rotateDuplicates` |`boolean`| Whether or not to rotate the duplicates as they are copied. | No |

View File

@ -55,9 +55,9 @@ A tag for the face.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `__meta` |`array`| | No |
| `info` |`object`| Engine information for a tag. | No |
| `value` |`string`| | No |
| `info` |`object`| Engine information for a tag. | No |
| `__meta` |`array`| | No |
----

View File

@ -16,9 +16,9 @@ Data for helices.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `revolutions` |`number` (`double`)| Number of revolutions. | No |
| `angleStart` |`number` (`double`)| Start angle (in degrees). | No |
| `ccw` |`boolean`| Is the helix rotation counter clockwise? The default is &#x60;false&#x60;. | No |
| `length` |`number` (`double`)| Length of the helix. If this argument is not provided, the height of the solid is used. | No |
| `revolutions` |`number` (`double`)| Number of revolutions. | No |

View File

@ -55,8 +55,8 @@ Wavefront OBJ format.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `coords` |`object`| Co-ordinate system of input data. Defaults to the [KittyCAD co-ordinate system. | No |
| `type` |enum: `obj`| | No |
| `coords` |`object`| Co-ordinate system of input data. Defaults to the [KittyCAD co-ordinate system. | No |
| `units` |`oneOf`| The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc. Defaults to millimeters. | No |
@ -73,8 +73,8 @@ The PLY Polygon File Format.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `coords` |`object`| Co-ordinate system of input data. Defaults to the [KittyCAD co-ordinate system. | No |
| `type` |enum: `ply`| | No |
| `coords` |`object`| Co-ordinate system of input data. Defaults to the [KittyCAD co-ordinate system. | No |
| `units` |`oneOf`| The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc. Defaults to millimeters. | No |
@ -123,8 +123,8 @@ ST**ereo**L**ithography format.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `coords` |`object`| Co-ordinate system of input data. Defaults to the [KittyCAD co-ordinate system. | No |
| `type` |enum: `stl`| | No |
| `coords` |`object`| Co-ordinate system of input data. Defaults to the [KittyCAD co-ordinate system. | No |
| `units` |`oneOf`| The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc. Defaults to millimeters. | No |

View File

@ -16,8 +16,8 @@ Data for an imported geometry.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `__meta` |`array`| | No |
| `id` |`string` (`uuid`)| The ID of the imported geometry. | No |
| `value` |`array`| The original file paths. | No |
| `__meta` |`array`| | No |

View File

@ -16,8 +16,8 @@ Data for a linear pattern on a 2D sketch.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `axis` |`array`| The axis of the pattern. This is a 2D vector. | No |
| `distance` |`number` (`double`)| The distance between each repetition. This can also be referred to as spacing. | No |
| `repetitions` |`integer` (`uint32`)| The number of repetitions. Must be greater than 0. This excludes the original entity. For example, if &#x60;repetitions&#x60; is 1, the original entity will be copied once. | No |
| `distance` |`number` (`double`)| The distance between each repetition. This can also be referred to as spacing. | No |
| `axis` |`array`| The axis of the pattern. This is a 2D vector. | No |

View File

@ -16,8 +16,8 @@ Data for a linear pattern on a 3D model.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `axis` |`array`| The axis of the pattern. | No |
| `distance` |`number` (`double`)| The distance between each repetition. This can also be referred to as spacing. | No |
| `repetitions` |`integer` (`uint32`)| The number of repetitions. Must be greater than 0. This excludes the original entity. For example, if &#x60;repetitions&#x60; is 1, the original entity will be copied once. | No |
| `distance` |`number` (`double`)| The distance between each repetition. This can also be referred to as spacing. | No |
| `axis` |`array`| The axis of the pattern. | No |

View File

@ -16,9 +16,9 @@ Data for a loft.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `baseCurveIndex` |`integer` (`uint32`)| This can be set to override the automatically determined topological base curve, which is usually the first section encountered. | No |
| `bezApproximateRational` |`boolean`| Attempt to approximate rational curves (such as arcs) using a bezier. This will remove banding around interpolations between arcs and non-arcs. It may produce errors in other scenarios Over time, this field won&#x27;t be necessary. | No |
| `tolerance` |`number` (`double`)| Tolerance for the loft operation. | No |
| `vDegree` |`integer` (`uint32`)| Degree of the interpolation. Must be greater than zero. For example, use 2 for quadratic, or 3 for cubic interpolation in the V direction. This defaults to 2, if not specified. | No |
| `bezApproximateRational` |`boolean`| Attempt to approximate rational curves (such as arcs) using a bezier. This will remove banding around interpolations between arcs and non-arcs. It may produce errors in other scenarios Over time, this field won&#x27;t be necessary. | No |
| `baseCurveIndex` |`integer` (`uint32`)| This can be set to override the automatically determined topological base curve, which is usually the first section encountered. | No |
| `tolerance` |`number` (`double`)| Tolerance for the loft operation. | No |

View File

@ -16,7 +16,7 @@ Data for shells.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `faces` |`array`| The faces you want removed. | No |
| `thickness` |`number` (`double`)| The thickness of the shell. | No |
| `faces` |`array`| The faces you want removed. | No |

View File

@ -16,11 +16,11 @@ A sketch is a collection of paths.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `__meta` |`array`| Metadata. | No |
| `id` |`string` (`uuid`)| The id of the sketch (this will change when the engine&#x27;s reference to it changes. | No |
| `value` |`array`| The paths in the sketch. | No |
| `on` |`oneOf`| What the sketch is on (can be a plane or a face). | No |
| `start` |`object`| The starting path. | No |
| `tags` |`object`| Tag identifiers that have been declared in this sketch. | No |
| `value` |`array`| The paths in the sketch. | No |
| `__meta` |`array`| Metadata. | No |

View File

@ -116,14 +116,14 @@ An solid is a collection of extrude surfaces.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `__meta` |`array`| Metadata. | No |
| `edgeCuts` |`array`| Chamfers or fillets on this solid. | No |
| `endCapId` |`string` (`uuid`)| The id of the extrusion end cap | No |
| `height` |`number` (`double`)| The height of the solid. | No |
| `id` |`string` (`uuid`)| The id of the solid. | No |
| `sketch` |`object`| The sketch. | No |
| `startCapId` |`string` (`uuid`)| The id of the extrusion start cap | No |
| `value` |`array`| The extrude surfaces. | No |
| `sketch` |`object`| The sketch. | No |
| `height` |`number` (`double`)| The height of the solid. | No |
| `startCapId` |`string` (`uuid`)| The id of the extrusion start cap | No |
| `endCapId` |`string` (`uuid`)| The id of the extrusion end cap | No |
| `edgeCuts` |`array`| Chamfers or fillets on this solid. | No |
| `__meta` |`array`| Metadata. | No |
----

View File

@ -29,14 +29,14 @@ A plane.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `__meta` |`array`| | No |
| `id` |`string` (`uuid`)| The id of the plane. | No |
| `origin` |`object`| Origin of the plane. | No |
| `type` |enum: `plane`| | No |
| `id` |`string` (`uuid`)| The id of the plane. | No |
| `value` |`oneOf`| Type for a plane. | No |
| `origin` |`object`| Origin of the plane. | No |
| `xAxis` |`object`| What should the planes X axis be? | No |
| `yAxis` |`object`| What should the planes Y axis be? | No |
| `zAxis` |`object`| The z-axis (normal). | No |
| `__meta` |`array`| | No |
----
@ -52,14 +52,14 @@ A face.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `__meta` |`array`| | No |
| `id` |`string` (`uuid`)| The id of the face. | No |
| `solid` |`object`| The solid the face is on. | No |
| `type` |enum: `face`| | No |
| `id` |`string` (`uuid`)| The id of the face. | No |
| `value` |`string`| The tag of the face. | No |
| `xAxis` |`object`| What should the faces X axis be? | No |
| `yAxis` |`object`| What should the faces Y axis be? | No |
| `zAxis` |`object`| The z-axis (normal). | No |
| `solid` |`object`| The solid the face is on. | No |
| `__meta` |`array`| | No |
----
@ -80,12 +80,12 @@ A sketch is a collection of paths.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `__meta` |`array`| Metadata. | No |
| `id` |`string` (`uuid`)| The id of the sketch (this will change when the engine&#x27;s reference to it changes. | No |
| `value` |`array`| The paths in the sketch. | No |
| `on` |`oneOf`| What the sketch is on (can be a plane or a face). | No |
| `start` |`object`| The starting path. | No |
| `tags` |`object`| Tag identifiers that have been declared in this sketch. | No |
| `value` |`array`| The paths in the sketch. | No |
| `__meta` |`array`| Metadata. | No |
----

View File

@ -23,13 +23,13 @@ A sketch is a collection of paths.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `__meta` |`array`| Metadata. | No |
| `type` |enum: `sketch`| | No |
| `id` |`string` (`uuid`)| The id of the sketch (this will change when the engine&#x27;s reference to it changes. | No |
| `value` |`array`| The paths in the sketch. | No |
| `on` |`oneOf`| What the sketch is on (can be a plane or a face). | No |
| `start` |`object`| The starting path. | No |
| `tags` |`object`| Tag identifiers that have been declared in this sketch. | No |
| `type` |enum: `sketch`| | No |
| `value` |`array`| The paths in the sketch. | No |
| `__meta` |`array`| Metadata. | No |
----

View File

@ -23,14 +23,14 @@ A plane.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `__meta` |`array`| | No |
| `id` |`string` (`uuid`)| The id of the plane. | No |
| `origin` |`object`| Origin of the plane. | No |
| `type` |enum: `plane`| | No |
| `id` |`string` (`uuid`)| The id of the plane. | No |
| `value` |`oneOf`| Type for a plane. | No |
| `origin` |`object`| Origin of the plane. | No |
| `xAxis` |`object`| What should the planes X axis be? | No |
| `yAxis` |`object`| What should the planes Y axis be? | No |
| `zAxis` |`object`| The z-axis (normal). | No |
| `__meta` |`array`| | No |
----
@ -46,14 +46,14 @@ A face.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `__meta` |`array`| | No |
| `id` |`string` (`uuid`)| The id of the face. | No |
| `solid` |`object`| The solid the face is on. | No |
| `type` |enum: `face`| | No |
| `id` |`string` (`uuid`)| The id of the face. | No |
| `value` |`string`| The tag of the face. | No |
| `xAxis` |`object`| What should the faces X axis be? | No |
| `yAxis` |`object`| What should the faces Y axis be? | No |
| `zAxis` |`object`| The z-axis (normal). | No |
| `solid` |`object`| The solid the face is on. | No |
| `__meta` |`array`| | No |
----

View File

@ -16,13 +16,13 @@ An solid is a collection of extrude surfaces.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `__meta` |`array`| Metadata. | No |
| `edgeCuts` |`array`| Chamfers or fillets on this solid. | No |
| `endCapId` |`string` (`uuid`)| The id of the extrusion end cap | No |
| `height` |`number` (`double`)| The height of the solid. | No |
| `id` |`string` (`uuid`)| The id of the solid. | No |
| `sketch` |`object`| The sketch. | No |
| `startCapId` |`string` (`uuid`)| The id of the extrusion start cap | No |
| `value` |`array`| The extrude surfaces. | No |
| `sketch` |`object`| The sketch. | No |
| `height` |`number` (`double`)| The height of the solid. | No |
| `startCapId` |`string` (`uuid`)| The id of the extrusion start cap | No |
| `endCapId` |`string` (`uuid`)| The id of the extrusion end cap | No |
| `edgeCuts` |`array`| Chamfers or fillets on this solid. | No |
| `__meta` |`array`| Metadata. | No |

View File

@ -23,15 +23,15 @@ An solid is a collection of extrude surfaces.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `__meta` |`array`| Metadata. | No |
| `edgeCuts` |`array`| Chamfers or fillets on this solid. | No |
| `endCapId` |`string` (`uuid`)| The id of the extrusion end cap | No |
| `height` |`number` (`double`)| The height of the solid. | No |
| `id` |`string` (`uuid`)| The id of the solid. | No |
| `sketch` |`object`| The sketch. | No |
| `startCapId` |`string` (`uuid`)| The id of the extrusion start cap | No |
| `type` |enum: `solid`| | No |
| `id` |`string` (`uuid`)| The id of the solid. | No |
| `value` |`array`| The extrude surfaces. | No |
| `sketch` |`object`| The sketch. | No |
| `height` |`number` (`double`)| The height of the solid. | No |
| `startCapId` |`string` (`uuid`)| The id of the extrusion start cap | No |
| `endCapId` |`string` (`uuid`)| The id of the extrusion end cap | No |
| `edgeCuts` |`array`| Chamfers or fillets on this solid. | No |
| `__meta` |`array`| Metadata. | No |
----

View File

@ -21,8 +21,8 @@ Data to draw a tangential arc.
| Property | Type | Description | Required |
|----------|------|-------------|----------|
| `offset` |`number` (`double`)| Offset of the arc, in degrees. | No |
| `radius` |`number` (`double`)| Radius of the arc. Not to be confused with Raiders of the Lost Ark. | No |
| `offset` |`number` (`double`)| Offset of the arc, in degrees. | No |
----

View File

@ -1303,6 +1303,7 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
dependencies = [
"autocfg",
"hashbrown 0.12.3",
"serde",
]
[[package]]
@ -2704,6 +2705,7 @@ dependencies = [
"bytes",
"chrono",
"dyn-clone",
"indexmap 1.9.3",
"schemars_derive",
"serde",
"serde_json",

View File

@ -37,7 +37,7 @@ parse-display = "0.9.1"
pyo3 = { version = "0.22.3", optional = true }
reqwest = { version = "0.11.26", default-features = false, features = ["stream", "rustls-tls"] }
ropey = "1.6.1"
schemars = { version = "0.8.17", features = ["impl_json_schema", "url", "uuid1"] }
schemars = { version = "0.8.17", features = ["impl_json_schema", "url", "uuid1", "preserve_order"] }
serde = { version = "1.0.210", features = ["derive"] }
serde_json = "1.0.128"
sha2 = "0.10.8"

View File

@ -807,10 +807,10 @@ mod tests {
assert_eq!(
snippet,
r#"patternCircular3d({
arcDegrees: ${0:3.14},
repetitions: ${0:10},
axis: [${1:3.14}, ${2:3.14}, ${3:3.14}],
center: [${4:3.14}, ${5:3.14}, ${6:3.14}],
repetitions: ${7:10},
arcDegrees: ${7:3.14},
rotateDuplicates: ${8:false},
}, ${9:%})${}"#
);
@ -848,8 +848,8 @@ mod tests {
assert_eq!(
snippet,
r#"arc({
angleEnd: ${0:3.14},
angleStart: ${1:3.14},
angleStart: ${0:3.14},
angleEnd: ${1:3.14},
radius: ${2:3.14},
}, ${3:%})${}"#
);
@ -862,9 +862,9 @@ mod tests {
assert_eq!(
snippet,
r#"patternLinear2d({
axis: [${0:3.14}, ${1:3.14}],
distance: ${2:3.14},
repetitions: ${3:10},
repetitions: ${0:10},
distance: ${1:3.14},
axis: [${2:3.14}, ${3:3.14}],
}, ${4:%})${}"#
);
}