diff --git a/docs/kcl/angleToMatchLengthX.md b/docs/kcl/angleToMatchLengthX.md index f866c3471..89b44a5bb 100644 --- a/docs/kcl/angleToMatchLengthX.md +++ b/docs/kcl/angleToMatchLengthX.md @@ -9,7 +9,11 @@ Returns the angle to match the given length for x. ```js -angleToMatchLengthX(tag: TagIdentifier, to: number, sketch: Sketch) -> number +angleToMatchLengthX( + tag: TagIdentifier, + to: number, + sketch: Sketch, +) -> number ``` diff --git a/docs/kcl/angleToMatchLengthY.md b/docs/kcl/angleToMatchLengthY.md index 962e377f8..f36d7794a 100644 --- a/docs/kcl/angleToMatchLengthY.md +++ b/docs/kcl/angleToMatchLengthY.md @@ -9,7 +9,11 @@ Returns the angle to match the given length for y. ```js -angleToMatchLengthY(tag: TagIdentifier, to: number, sketch: Sketch) -> number +angleToMatchLengthY( + tag: TagIdentifier, + to: number, + sketch: Sketch, +) -> number ``` diff --git a/docs/kcl/angledLine.md b/docs/kcl/angledLine.md index a8fc677be..43016f97c 100644 --- a/docs/kcl/angledLine.md +++ b/docs/kcl/angledLine.md @@ -9,7 +9,11 @@ Draw a line segment relative to the current origin using the polar measure of some angle and distance. ```js -angledLine(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) -> Sketch +angledLine( + data: AngledLineData, + sketch: Sketch, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/angledLineOfXLength.md b/docs/kcl/angledLineOfXLength.md index d6b01cae9..d967ea468 100644 --- a/docs/kcl/angledLineOfXLength.md +++ b/docs/kcl/angledLineOfXLength.md @@ -9,7 +9,11 @@ Create a line segment from the current 2-dimensional sketch origin along some angle (in degrees) for some relative length in the 'x' dimension. ```js -angledLineOfXLength(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) -> Sketch +angledLineOfXLength( + data: AngledLineData, + sketch: Sketch, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/angledLineOfYLength.md b/docs/kcl/angledLineOfYLength.md index b547ee639..b89dce51a 100644 --- a/docs/kcl/angledLineOfYLength.md +++ b/docs/kcl/angledLineOfYLength.md @@ -9,7 +9,11 @@ Create a line segment from the current 2-dimensional sketch origin along some angle (in degrees) for some relative length in the 'y' dimension. ```js -angledLineOfYLength(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) -> Sketch +angledLineOfYLength( + data: AngledLineData, + sketch: Sketch, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/angledLineThatIntersects.md b/docs/kcl/angledLineThatIntersects.md index 9162f1f18..85bc54412 100644 --- a/docs/kcl/angledLineThatIntersects.md +++ b/docs/kcl/angledLineThatIntersects.md @@ -9,7 +9,11 @@ Draw an angled line from the current origin, constructing a line segment such that the newly created line intersects the desired target line segment. ```js -angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch: Sketch, tag?: TagDeclarator) -> Sketch +angledLineThatIntersects( + data: AngledLineThatIntersectsData, + sketch: Sketch, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/angledLineToX.md b/docs/kcl/angledLineToX.md index 2536c8930..9637047af 100644 --- a/docs/kcl/angledLineToX.md +++ b/docs/kcl/angledLineToX.md @@ -9,7 +9,11 @@ Create a line segment from the current 2-dimensional sketch origin along some angle (in degrees) for some length, ending at the provided value in the 'x' dimension. ```js -angledLineToX(data: AngledLineToData, sketch: Sketch, tag?: TagDeclarator) -> Sketch +angledLineToX( + data: AngledLineToData, + sketch: Sketch, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/angledLineToY.md b/docs/kcl/angledLineToY.md index 63a341e26..b1f645e6c 100644 --- a/docs/kcl/angledLineToY.md +++ b/docs/kcl/angledLineToY.md @@ -9,7 +9,11 @@ Create a line segment from the current 2-dimensional sketch origin along some angle (in degrees) for some length, ending at the provided value in the 'y' dimension. ```js -angledLineToY(data: AngledLineToData, sketch: Sketch, tag?: TagDeclarator) -> Sketch +angledLineToY( + data: AngledLineToData, + sketch: Sketch, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/appearance.md b/docs/kcl/appearance.md index 352cf3414..ad6c5f110 100644 --- a/docs/kcl/appearance.md +++ b/docs/kcl/appearance.md @@ -9,7 +9,12 @@ Set the appearance of a solid. This only works on solids, not sketches or indivi This will work on any solid, including extruded solids, revolved solids, and shelled solids. ```js -appearance(solidSet: SolidSet, color: String, metalness?: number, roughness?: number) -> SolidSet +appearance( + solidSet: SolidSet, + color: String, + metalness?: number, + roughness?: number, +) -> SolidSet ``` diff --git a/docs/kcl/arc.md b/docs/kcl/arc.md index fe508c8ea..69f5d4fc2 100644 --- a/docs/kcl/arc.md +++ b/docs/kcl/arc.md @@ -11,7 +11,11 @@ The arc is constructed such that the current position of the sketch is placed al Unless this makes a lot of sense and feels like what you're looking for to construct your shape, you're likely looking for tangentialArc. ```js -arc(data: ArcData, sketch: Sketch, tag?: TagDeclarator) -> Sketch +arc( + data: ArcData, + sketch: Sketch, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/arcTo.md b/docs/kcl/arcTo.md index 8c2b97dd6..5f4f84354 100644 --- a/docs/kcl/arcTo.md +++ b/docs/kcl/arcTo.md @@ -9,7 +9,11 @@ Draw a 3 point arc. The arc is constructed such that the start point is the current position of the sketch and two more points defined as the end and interior point. The interior point is placed between the start point and end point. The radius of the arc will be controlled by how far the interior point is placed from the start and end. ```js -arcTo(data: ArcToData, sketch: Sketch, tag?: TagDeclarator) -> Sketch +arcTo( + data: ArcToData, + sketch: Sketch, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/assert.md b/docs/kcl/assert.md index f30a1b746..2e1b51114 100644 --- a/docs/kcl/assert.md +++ b/docs/kcl/assert.md @@ -9,7 +9,10 @@ Check a value at runtime, and raise an error if the argument provided is false. ```js -assert(data: bool, message: string) -> () +assert( + data: bool, + message: string, +) -> () ``` diff --git a/docs/kcl/assertEqual.md b/docs/kcl/assertEqual.md index 31c0cd73a..ecbff1e33 100644 --- a/docs/kcl/assertEqual.md +++ b/docs/kcl/assertEqual.md @@ -9,7 +9,12 @@ Check that a numerical value equals another at runtime, otherwise raise an error. ```js -assertEqual(left: number, right: number, epsilon: number, message: string) -> () +assertEqual( + left: number, + right: number, + epsilon: number, + message: string, +) -> () ``` diff --git a/docs/kcl/assertGreaterThan.md b/docs/kcl/assertGreaterThan.md index 25a7c7fef..722f14e5c 100644 --- a/docs/kcl/assertGreaterThan.md +++ b/docs/kcl/assertGreaterThan.md @@ -9,7 +9,11 @@ Check that a numerical value is greater than another at runtime, otherwise raise an error. ```js -assertGreaterThan(left: number, right: number, message: string) -> () +assertGreaterThan( + left: number, + right: number, + message: string, +) -> () ``` diff --git a/docs/kcl/assertGreaterThanOrEq.md b/docs/kcl/assertGreaterThanOrEq.md index cfacf6f85..90b8ccb74 100644 --- a/docs/kcl/assertGreaterThanOrEq.md +++ b/docs/kcl/assertGreaterThanOrEq.md @@ -9,7 +9,11 @@ Check that a numerical value is greater than or equal to another at runtime, otherwise raise an error. ```js -assertGreaterThanOrEq(left: number, right: number, message: string) -> () +assertGreaterThanOrEq( + left: number, + right: number, + message: string, +) -> () ``` diff --git a/docs/kcl/assertLessThan.md b/docs/kcl/assertLessThan.md index 0017cb5f4..2ce4efd00 100644 --- a/docs/kcl/assertLessThan.md +++ b/docs/kcl/assertLessThan.md @@ -9,7 +9,11 @@ Check that a numerical value is less than to another at runtime, otherwise raise an error. ```js -assertLessThan(left: number, right: number, message: string) -> () +assertLessThan( + left: number, + right: number, + message: string, +) -> () ``` diff --git a/docs/kcl/assertLessThanOrEq.md b/docs/kcl/assertLessThanOrEq.md index 5898f4e26..b041e06f3 100644 --- a/docs/kcl/assertLessThanOrEq.md +++ b/docs/kcl/assertLessThanOrEq.md @@ -9,7 +9,11 @@ Check that a numerical value is less than or equal to another at runtime, otherwise raise an error. ```js -assertLessThanOrEq(left: number, right: number, message: string) -> () +assertLessThanOrEq( + left: number, + right: number, + message: string, +) -> () ``` diff --git a/docs/kcl/atan2.md b/docs/kcl/atan2.md index e98d25a07..361356019 100644 --- a/docs/kcl/atan2.md +++ b/docs/kcl/atan2.md @@ -9,7 +9,10 @@ Compute the four quadrant arctangent of Y and X (in radians). ```js -atan2(y: number, x: number) -> number +atan2( + y: number, + x: number, +) -> number ``` ### Tags diff --git a/docs/kcl/bezierCurve.md b/docs/kcl/bezierCurve.md index 948d88a55..29b697604 100644 --- a/docs/kcl/bezierCurve.md +++ b/docs/kcl/bezierCurve.md @@ -9,7 +9,11 @@ Draw a smooth, continuous, curved line segment from the current origin to the desired (x, y), using a number of control points to shape the curve's shape. ```js -bezierCurve(data: BezierData, sketch: Sketch, tag?: TagDeclarator) -> Sketch +bezierCurve( + data: BezierData, + sketch: Sketch, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/chamfer.md b/docs/kcl/chamfer.md index 26500acd9..6c4a0e55a 100644 --- a/docs/kcl/chamfer.md +++ b/docs/kcl/chamfer.md @@ -9,7 +9,12 @@ Cut a straight transitional edge along a tagged path. Chamfer is similar in function and use to a fillet, except a fillet will blend the transition along an edge, rather than cut a sharp, straight transitional edge. ```js -chamfer(solid: Solid, length: number, tags: [EdgeReference], tag?: TagDeclarator) -> Solid +chamfer( + solid: Solid, + length: number, + tags: [EdgeReference], + tag?: TagDeclarator, +) -> Solid ``` diff --git a/docs/kcl/circle.md b/docs/kcl/circle.md index 59f8815b5..24c76ce50 100644 --- a/docs/kcl/circle.md +++ b/docs/kcl/circle.md @@ -9,7 +9,11 @@ Construct a 2-dimensional circle, of the specified radius, centered at the provided (x, y) origin point. ```js -circle(data: CircleData, sketchSurfaceOrGroup: SketchOrSurface, tag?: TagDeclarator) -> Sketch +circle( + data: CircleData, + sketchSurfaceOrGroup: SketchOrSurface, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/circleThreePoint.md b/docs/kcl/circleThreePoint.md index 1cf264027..f392ccc29 100644 --- a/docs/kcl/circleThreePoint.md +++ b/docs/kcl/circleThreePoint.md @@ -9,7 +9,13 @@ Construct a circle derived from 3 points. ```js -circleThreePoint(p1: [number], p2: [number], p3: [number], sketchSurfaceOrGroup: SketchOrSurface, tag?: TagDeclarator) -> Sketch +circleThreePoint( + p1: [number], + p2: [number], + p3: [number], + sketchSurfaceOrGroup: SketchOrSurface, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/close.md b/docs/kcl/close.md index 6919769d5..82b6fec97 100644 --- a/docs/kcl/close.md +++ b/docs/kcl/close.md @@ -9,7 +9,10 @@ Construct a line segment from the current origin back to the profile's origin, ensuring the resulting 2-dimensional sketch is not open-ended. ```js -close(sketch: Sketch, tag?: TagDeclarator) -> Sketch +close( + sketch: Sketch, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/extrude.md b/docs/kcl/extrude.md index 0f0f9f9b1..6d1376cca 100644 --- a/docs/kcl/extrude.md +++ b/docs/kcl/extrude.md @@ -9,7 +9,10 @@ Extend a 2-dimensional sketch through a third dimension in order to create new 3-dimensional volume, or if extruded into an existing volume, cut into an existing solid. ```js -extrude(sketchSet: SketchSet, length: number) -> SolidSet +extrude( + sketchSet: SketchSet, + length: number, +) -> SolidSet ``` diff --git a/docs/kcl/fillet.md b/docs/kcl/fillet.md index 828b73cf7..e8f269f2d 100644 --- a/docs/kcl/fillet.md +++ b/docs/kcl/fillet.md @@ -9,7 +9,13 @@ Blend a transitional edge along a tagged path, smoothing the sharp edge. Fillet is similar in function and use to a chamfer, except a chamfer will cut a sharp transition along an edge while fillet will smoothly blend the transition. ```js -fillet(solid: Solid, radius: number, tags: [EdgeReference], tolerance?: number, tag?: TagDeclarator) -> Solid +fillet( + solid: Solid, + radius: number, + tags: [EdgeReference], + tolerance?: number, + tag?: TagDeclarator, +) -> Solid ``` diff --git a/docs/kcl/helix.md b/docs/kcl/helix.md index c137b8b6c..f03e0c058 100644 --- a/docs/kcl/helix.md +++ b/docs/kcl/helix.md @@ -9,7 +9,14 @@ Create a helix. ```js -helix(revolutions: number, angleStart: number, ccw?: bool, radius: number, axis: Axis3dOrEdgeReference, length?: number) -> HelixValue +helix( + revolutions: number, + angleStart: number, + ccw?: bool, + radius: number, + axis: Axis3dOrEdgeReference, + length?: number, +) -> HelixValue ``` diff --git a/docs/kcl/helixRevolutions.md b/docs/kcl/helixRevolutions.md index 4a7dd8b50..fb08a5b41 100644 --- a/docs/kcl/helixRevolutions.md +++ b/docs/kcl/helixRevolutions.md @@ -9,7 +9,10 @@ Create a helix on a cylinder. ```js -helixRevolutions(data: HelixRevolutionsData, solid: Solid) -> Solid +helixRevolutions( + data: HelixRevolutionsData, + solid: Solid, +) -> Solid ``` diff --git a/docs/kcl/hole.md b/docs/kcl/hole.md index 12acfc0db..4b4433360 100644 --- a/docs/kcl/hole.md +++ b/docs/kcl/hole.md @@ -9,7 +9,10 @@ Use a 2-dimensional sketch to cut a hole in another 2-dimensional sketch. ```js -hole(holeSketch: SketchSet, sketch: Sketch) -> Sketch +hole( + holeSketch: SketchSet, + sketch: Sketch, +) -> Sketch ``` diff --git a/docs/kcl/hollow.md b/docs/kcl/hollow.md index 1746df2d5..bd8054080 100644 --- a/docs/kcl/hollow.md +++ b/docs/kcl/hollow.md @@ -9,7 +9,10 @@ Make the inside of a 3D object hollow. Remove volume from a 3-dimensional shape such that a wall of the provided thickness remains around the exterior of the shape. ```js -hollow(thickness: number, solid: Solid) -> Solid +hollow( + thickness: number, + solid: Solid, +) -> Solid ``` diff --git a/docs/kcl/import.md b/docs/kcl/import.md index 91053ceb4..bde04cd6f 100644 --- a/docs/kcl/import.md +++ b/docs/kcl/import.md @@ -15,7 +15,10 @@ For formats lacking unit data (such as STL, OBJ, or PLY files), the default unit Note: The import command currently only works when using the native Modeling App. ```js -import(filePath: String, options?: ImportFormat) -> ImportedGeometry +import( + filePath: String, + options?: ImportFormat, +) -> ImportedGeometry ``` diff --git a/docs/kcl/legAngX.md b/docs/kcl/legAngX.md index 0db7b25fa..70bbbb6d0 100644 --- a/docs/kcl/legAngX.md +++ b/docs/kcl/legAngX.md @@ -9,7 +9,10 @@ Compute the angle of the given leg for x. ```js -legAngX(hypotenuse: number, leg: number) -> number +legAngX( + hypotenuse: number, + leg: number, +) -> number ``` ### Tags diff --git a/docs/kcl/legAngY.md b/docs/kcl/legAngY.md index 1ce4f835a..e93d716a5 100644 --- a/docs/kcl/legAngY.md +++ b/docs/kcl/legAngY.md @@ -9,7 +9,10 @@ Compute the angle of the given leg for y. ```js -legAngY(hypotenuse: number, leg: number) -> number +legAngY( + hypotenuse: number, + leg: number, +) -> number ``` ### Tags diff --git a/docs/kcl/legLen.md b/docs/kcl/legLen.md index 177ba6fc0..96e5cca3e 100644 --- a/docs/kcl/legLen.md +++ b/docs/kcl/legLen.md @@ -9,7 +9,10 @@ Compute the length of the given leg. ```js -legLen(hypotenuse: number, leg: number) -> number +legLen( + hypotenuse: number, + leg: number, +) -> number ``` ### Tags diff --git a/docs/kcl/line.md b/docs/kcl/line.md index ba6b39d42..f5fb59960 100644 --- a/docs/kcl/line.md +++ b/docs/kcl/line.md @@ -9,7 +9,12 @@ Extend the current sketch with a new straight line. ```js -line(sketch: Sketch, endAbsolute?: [number], end?: [number], tag?: TagDeclarator) -> Sketch +line( + sketch: Sketch, + endAbsolute?: [number], + end?: [number], + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/loft.md b/docs/kcl/loft.md index 796a031d5..d62e3c9ca 100644 --- a/docs/kcl/loft.md +++ b/docs/kcl/loft.md @@ -9,7 +9,13 @@ Create a 3D surface or solid by interpolating between two or more sketches. The sketches need to closed and on the same plane. ```js -loft(sketches: [Sketch], vDegree: NonZeroU32, bezApproximateRational: bool, baseCurveIndex?: integer, tolerance?: number) -> Solid +loft( + sketches: [Sketch], + vDegree: NonZeroU32, + bezApproximateRational: bool, + baseCurveIndex?: integer, + tolerance?: number, +) -> Solid ``` diff --git a/docs/kcl/log.md b/docs/kcl/log.md index bb1987754..b6b78bbfd 100644 --- a/docs/kcl/log.md +++ b/docs/kcl/log.md @@ -9,7 +9,10 @@ Compute the logarithm of the number with respect to an arbitrary base. The result might not be correctly rounded owing to implementation details; `log2()` can produce more accurate results for base 2, and `log10()` can produce more accurate results for base 10. ```js -log(num: number, base: number) -> number +log( + num: number, + base: number, +) -> number ``` ### Tags diff --git a/docs/kcl/map.md b/docs/kcl/map.md index ff42f212f..f68d55294 100644 --- a/docs/kcl/map.md +++ b/docs/kcl/map.md @@ -9,7 +9,10 @@ Apply a function to every element of a list. Given a list like `[a, b, c]`, and a function like `f`, returns `[f(a), f(b), f(c)]` ```js -map(array: [KclValue], mapFn: FunctionSource) -> [KclValue] +map( + array: [KclValue], + mapFn: FunctionSource, +) -> [KclValue] ``` diff --git a/docs/kcl/mirror2d.md b/docs/kcl/mirror2d.md index 80e0a848a..1b4f98829 100644 --- a/docs/kcl/mirror2d.md +++ b/docs/kcl/mirror2d.md @@ -11,7 +11,10 @@ Only works on unclosed sketches for now. Mirror occurs around a local sketch axis rather than a global axis. ```js -mirror2d(data: Mirror2dData, sketchSet: SketchSet) -> [Sketch] +mirror2d( + data: Mirror2dData, + sketchSet: SketchSet, +) -> [Sketch] ``` diff --git a/docs/kcl/offsetPlane.md b/docs/kcl/offsetPlane.md index 179f9bbb4..e19ff13f4 100644 --- a/docs/kcl/offsetPlane.md +++ b/docs/kcl/offsetPlane.md @@ -9,7 +9,10 @@ Offset a plane by a distance along its normal. For example, if you offset the 'XZ' plane by 10, the new plane will be parallel to the 'XZ' plane and 10 units away from it. ```js -offsetPlane(plane: PlaneData, offset: number) -> Plane +offsetPlane( + plane: PlaneData, + offset: number, +) -> Plane ``` diff --git a/docs/kcl/patternCircular2d.md b/docs/kcl/patternCircular2d.md index e9837f106..eb7497a8e 100644 --- a/docs/kcl/patternCircular2d.md +++ b/docs/kcl/patternCircular2d.md @@ -9,7 +9,14 @@ Repeat a 2-dimensional sketch some number of times along a partial or complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orentation of the solid with respect to the center of the circle is maintained. ```js -patternCircular2d(sketchSet: SketchSet, instances: integer, center: [number], arcDegrees: number, rotateDuplicates: bool, useOriginal?: bool) -> [Sketch] +patternCircular2d( + sketchSet: SketchSet, + instances: integer, + center: [number], + arcDegrees: number, + rotateDuplicates: bool, + useOriginal?: bool, +) -> [Sketch] ``` diff --git a/docs/kcl/patternCircular3d.md b/docs/kcl/patternCircular3d.md index 31acd1e9a..0680cefa5 100644 --- a/docs/kcl/patternCircular3d.md +++ b/docs/kcl/patternCircular3d.md @@ -9,7 +9,15 @@ Repeat a 3-dimensional solid some number of times along a partial or complete circle some specified number of times. Each object may additionally be rotated along the circle, ensuring orentation of the solid with respect to the center of the circle is maintained. ```js -patternCircular3d(solidSet: SolidSet, instances: integer, axis: [number], center: [number], arcDegrees: number, rotateDuplicates: bool, useOriginal?: bool) -> [Solid] +patternCircular3d( + solidSet: SolidSet, + instances: integer, + axis: [number], + center: [number], + arcDegrees: number, + rotateDuplicates: bool, + useOriginal?: bool, +) -> [Solid] ``` diff --git a/docs/kcl/patternLinear2d.md b/docs/kcl/patternLinear2d.md index b886be755..657e7c7cb 100644 --- a/docs/kcl/patternLinear2d.md +++ b/docs/kcl/patternLinear2d.md @@ -9,7 +9,13 @@ Repeat a 2-dimensional sketch along some dimension, with a dynamic amount of distance between each repetition, some specified number of times. ```js -patternLinear2d(sketchSet: SketchSet, instances: integer, distance: number, axis: [number], useOriginal?: bool) -> [Sketch] +patternLinear2d( + sketchSet: SketchSet, + instances: integer, + distance: number, + axis: [number], + useOriginal?: bool, +) -> [Sketch] ``` diff --git a/docs/kcl/patternLinear3d.md b/docs/kcl/patternLinear3d.md index b72853f79..b41dc1b61 100644 --- a/docs/kcl/patternLinear3d.md +++ b/docs/kcl/patternLinear3d.md @@ -11,7 +11,13 @@ of distance between each repetition, some specified number of times. /// ```js -patternLinear3d(solidSet: SolidSet, instances: integer, distance: number, axis: [number], useOriginal?: bool) -> [Solid] +patternLinear3d( + solidSet: SolidSet, + instances: integer, + distance: number, + axis: [number], + useOriginal?: bool, +) -> [Solid] ``` diff --git a/docs/kcl/patternTransform.md b/docs/kcl/patternTransform.md index b05fecb73..6647e0983 100644 --- a/docs/kcl/patternTransform.md +++ b/docs/kcl/patternTransform.md @@ -35,7 +35,12 @@ The transform function returns a transform object. All properties of the object - `rotation.origin` (either "local" i.e. rotate around its own center, "global" i.e. rotate around the scene's center, or a 3D point, defaults to "local") ```js -patternTransform(solidSet: SolidSet, instances: integer, transform: FunctionSource, useOriginal?: bool) -> [Solid] +patternTransform( + solidSet: SolidSet, + instances: integer, + transform: FunctionSource, + useOriginal?: bool, +) -> [Solid] ``` diff --git a/docs/kcl/patternTransform2d.md b/docs/kcl/patternTransform2d.md index 07f3e34e5..273bb83b4 100644 --- a/docs/kcl/patternTransform2d.md +++ b/docs/kcl/patternTransform2d.md @@ -9,7 +9,12 @@ Just like patternTransform, but works on 2D sketches not 3D solids. ```js -patternTransform2d(sketchSet: SketchSet, instances: integer, transform: FunctionSource, useOriginal?: bool) -> [Sketch] +patternTransform2d( + sketchSet: SketchSet, + instances: integer, + transform: FunctionSource, + useOriginal?: bool, +) -> [Sketch] ``` diff --git a/docs/kcl/polygon.md b/docs/kcl/polygon.md index 512fce494..d1cf3ee05 100644 --- a/docs/kcl/polygon.md +++ b/docs/kcl/polygon.md @@ -9,7 +9,11 @@ Create a regular polygon with the specified number of sides that is either inscr ```js -polygon(data: PolygonData, sketchSurfaceOrGroup: SketchOrSurface, tag?: TagDeclarator) -> Sketch +polygon( + data: PolygonData, + sketchSurfaceOrGroup: SketchOrSurface, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/pow.md b/docs/kcl/pow.md index 4df324b31..1b7c26cfa 100644 --- a/docs/kcl/pow.md +++ b/docs/kcl/pow.md @@ -9,7 +9,10 @@ Compute the number to a power. ```js -pow(num: number, pow: number) -> number +pow( + num: number, + pow: number, +) -> number ``` ### Tags diff --git a/docs/kcl/push.md b/docs/kcl/push.md index 321786b07..88cf838e4 100644 --- a/docs/kcl/push.md +++ b/docs/kcl/push.md @@ -9,7 +9,10 @@ Append an element to the end of an array. Returns a new array with the element appended. ```js -push(array: [KclValue], elem: KclValue) -> KclValue +push( + array: [KclValue], + elem: KclValue, +) -> KclValue ``` diff --git a/docs/kcl/reduce.md b/docs/kcl/reduce.md index 36fdf83af..008036c84 100644 --- a/docs/kcl/reduce.md +++ b/docs/kcl/reduce.md @@ -9,7 +9,11 @@ Take a starting value. Then, for each element of an array, calculate the next va using the previous value and the element. ```js -reduce(array: [KclValue], start: KclValue, reduceFn: FunctionSource) -> KclValue +reduce( + array: [KclValue], + start: KclValue, + reduceFn: FunctionSource, +) -> KclValue ``` diff --git a/docs/kcl/rem.md b/docs/kcl/rem.md index 50bbd4ac1..24cd6f937 100644 --- a/docs/kcl/rem.md +++ b/docs/kcl/rem.md @@ -9,7 +9,10 @@ Compute the remainder after dividing `num` by `div`. If `num` is negative, the result will be too. ```js -rem(num: number, divisor: number) -> number +rem( + num: number, + divisor: number, +) -> number ``` ### Tags diff --git a/docs/kcl/revolve.md b/docs/kcl/revolve.md index 2e93df0f0..5c5ff59ff 100644 --- a/docs/kcl/revolve.md +++ b/docs/kcl/revolve.md @@ -11,7 +11,10 @@ This, like extrude, is able to create a 3-dimensional solid from a 2-dimensional Revolve occurs around a local sketch axis rather than a global axis. ```js -revolve(data: RevolveData, sketch: Sketch) -> Solid +revolve( + data: RevolveData, + sketch: Sketch, +) -> Solid ``` diff --git a/docs/kcl/rotate.md b/docs/kcl/rotate.md index 999cabf2f..a75783be0 100644 --- a/docs/kcl/rotate.md +++ b/docs/kcl/rotate.md @@ -23,7 +23,15 @@ So, in the context of a 3D model: When rotating a part around an axis, you specify the axis of rotation and the angle of rotation. ```js -rotate(solid: Solid, roll?: number, pitch?: number, yaw?: number, axis?: [number], angle?: number, global?: bool) -> Solid +rotate( + solid: Solid, + roll?: number, + pitch?: number, + yaw?: number, + axis?: [number], + angle?: number, + global?: bool, +) -> Solid ``` diff --git a/docs/kcl/scale.md b/docs/kcl/scale.md index 017a5212e..8ff1d0b04 100644 --- a/docs/kcl/scale.md +++ b/docs/kcl/scale.md @@ -11,7 +11,11 @@ By default the transform is applied in local sketch axis, therefore the origin w If you want to apply the transform in global space, set `global` to `true`. The origin of the model will move. If the model is not centered on origin and you scale globally it will look like the model moves and gets bigger at the same time. Say you have a square `(1,1) - (1,2) - (2,2) - (2,1)` and you scale by 2 globally it will become `(2,2) - (2,4)`...etc so the origin has moved from `(1.5, 1.5)` to `(2,2)`. ```js -scale(solid: Solid, scale: [number], global?: bool) -> Solid +scale( + solid: Solid, + scale: [number], + global?: bool, +) -> Solid ``` diff --git a/docs/kcl/shell.md b/docs/kcl/shell.md index e313663b6..9aa7ee2fe 100644 --- a/docs/kcl/shell.md +++ b/docs/kcl/shell.md @@ -9,7 +9,11 @@ Remove volume from a 3-dimensional shape such that a wall of the provided thickness remains, taking volume starting at the provided face, leaving it open in that direction. ```js -shell(solidSet: SolidSet, thickness: number, faces: [FaceTag]) -> SolidSet +shell( + solidSet: SolidSet, + thickness: number, + faces: [FaceTag], +) -> SolidSet ``` diff --git a/docs/kcl/startProfileAt.md b/docs/kcl/startProfileAt.md index 9d352416e..fda685115 100644 --- a/docs/kcl/startProfileAt.md +++ b/docs/kcl/startProfileAt.md @@ -9,7 +9,11 @@ Start a new profile at a given point. ```js -startProfileAt(to: [number], sketchSurface: SketchSurface, tag?: TagDeclarator) -> Sketch +startProfileAt( + to: [number], + sketchSurface: SketchSurface, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/startSketchOn.md b/docs/kcl/startSketchOn.md index a7c0db353..22859bfc8 100644 --- a/docs/kcl/startSketchOn.md +++ b/docs/kcl/startSketchOn.md @@ -17,7 +17,10 @@ This is important to understand because if you were to then sketch on the result The point is if you want to export the result of a sketch on a face, you only need to export the final Solid that was created from the sketch on the face, since it will include all the parent faces and Solids. ```js -startSketchOn(data: SketchData, tag?: FaceTag) -> SketchSurface +startSketchOn( + data: SketchData, + tag?: FaceTag, +) -> SketchSurface ``` diff --git a/docs/kcl/sweep.md b/docs/kcl/sweep.md index 84e73e3ab..8c3a0a7c6 100644 --- a/docs/kcl/sweep.md +++ b/docs/kcl/sweep.md @@ -9,7 +9,12 @@ Extrude a sketch along a path. This, like extrude, is able to create a 3-dimensional solid from a 2-dimensional sketch. However, unlike extrude, this creates a solid by using the extent of the sketch as its path. This is useful for creating more complex shapes that can't be created with a simple extrusion. ```js -sweep(sketch: Sketch, path: SweepPath, sectional?: bool, tolerance?: number) -> Solid +sweep( + sketch: Sketch, + path: SweepPath, + sectional?: bool, + tolerance?: number, +) -> Solid ``` diff --git a/docs/kcl/tangentialArc.md b/docs/kcl/tangentialArc.md index 7e08e6d39..6618e9858 100644 --- a/docs/kcl/tangentialArc.md +++ b/docs/kcl/tangentialArc.md @@ -9,7 +9,11 @@ Draw a curved line segment along part of an imaginary circle. The arc is constructed such that the last line segment is placed tangent to the imaginary circle of the specified radius. The resulting arc is the segment of the imaginary circle from that tangent point for 'offset' degrees along the imaginary circle. ```js -tangentialArc(data: TangentialArcData, sketch: Sketch, tag?: TagDeclarator) -> Sketch +tangentialArc( + data: TangentialArcData, + sketch: Sketch, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/tangentialArcTo.md b/docs/kcl/tangentialArcTo.md index 15fcc0e01..fda06f49a 100644 --- a/docs/kcl/tangentialArcTo.md +++ b/docs/kcl/tangentialArcTo.md @@ -9,7 +9,11 @@ Starting at the current sketch's origin, draw a curved line segment along some part of an imaginary circle until it reaches the desired (x, y) coordinates. ```js -tangentialArcTo(to: [number], sketch: Sketch, tag?: TagDeclarator) -> Sketch +tangentialArcTo( + to: [number], + sketch: Sketch, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/tangentialArcToRelative.md b/docs/kcl/tangentialArcToRelative.md index e14e081ed..88f4b8d53 100644 --- a/docs/kcl/tangentialArcToRelative.md +++ b/docs/kcl/tangentialArcToRelative.md @@ -9,7 +9,11 @@ Starting at the current sketch's origin, draw a curved line segment along some part of an imaginary circle until it reaches a point the given (x, y) distance away. ```js -tangentialArcToRelative(delta: [number], sketch: Sketch, tag?: TagDeclarator) -> Sketch +tangentialArcToRelative( + delta: [number], + sketch: Sketch, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/translate.md b/docs/kcl/translate.md index 7e9f1644b..ddccec6f6 100644 --- a/docs/kcl/translate.md +++ b/docs/kcl/translate.md @@ -9,7 +9,11 @@ Move a solid. ```js -translate(solid: Solid, translate: [number], global?: bool) -> Solid +translate( + solid: Solid, + translate: [number], + global?: bool, +) -> Solid ``` diff --git a/docs/kcl/xLine.md b/docs/kcl/xLine.md index 72c46de74..1f1e79c3d 100644 --- a/docs/kcl/xLine.md +++ b/docs/kcl/xLine.md @@ -9,7 +9,11 @@ Draw a line relative to the current origin to a specified distance away from the current position along the 'x' axis. ```js -xLine(length: number, sketch: Sketch, tag?: TagDeclarator) -> Sketch +xLine( + length: number, + sketch: Sketch, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/xLineTo.md b/docs/kcl/xLineTo.md index bc62fc5f6..5fd62c892 100644 --- a/docs/kcl/xLineTo.md +++ b/docs/kcl/xLineTo.md @@ -9,7 +9,11 @@ Draw a line parallel to the X axis, that ends at the given X. E.g. if the previous line ended at (1, 1), then xLineTo(4) draws a line from (1, 1) to (4, 1) ```js -xLineTo(to: number, sketch: Sketch, tag?: TagDeclarator) -> Sketch +xLineTo( + to: number, + sketch: Sketch, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/yLine.md b/docs/kcl/yLine.md index 6e71e1740..c17a27dcd 100644 --- a/docs/kcl/yLine.md +++ b/docs/kcl/yLine.md @@ -9,7 +9,11 @@ Draw a line relative to the current origin to a specified distance away from the current position along the 'y' axis. ```js -yLine(length: number, sketch: Sketch, tag?: TagDeclarator) -> Sketch +yLine( + length: number, + sketch: Sketch, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/docs/kcl/yLineTo.md b/docs/kcl/yLineTo.md index 222f5295e..1fc491019 100644 --- a/docs/kcl/yLineTo.md +++ b/docs/kcl/yLineTo.md @@ -9,7 +9,11 @@ Draw a line parallel to the Y axis, that ends at the given Y. E.g. if the previous line ended at (1, 1), then yLineTo(4) draws a line from (1, 1) to (1, 4) ```js -yLineTo(to: number, sketch: Sketch, tag?: TagDeclarator) -> Sketch +yLineTo( + to: number, + sketch: Sketch, + tag?: TagDeclarator, +) -> Sketch ``` diff --git a/packages/codemirror-lsp-client/src/plugin/hover.ts b/packages/codemirror-lsp-client/src/plugin/hover.ts index c6739646e..ec2a843d7 100644 --- a/packages/codemirror-lsp-client/src/plugin/hover.ts +++ b/packages/codemirror-lsp-client/src/plugin/hover.ts @@ -28,6 +28,7 @@ export default function lspHoverExt( '.cm-tooltip': { fontSize: '12px', maxWidth: '400px', + padding: '2px', }, }), ] diff --git a/packages/codemirror-lsp-client/src/plugin/util.ts b/packages/codemirror-lsp-client/src/plugin/util.ts index c5812cb99..f70e429f3 100644 --- a/packages/codemirror-lsp-client/src/plugin/util.ts +++ b/packages/codemirror-lsp-client/src/plugin/util.ts @@ -1,5 +1,5 @@ import { Text } from '@codemirror/state' -import { Marked } from '@ts-stack/markdown' +import { Marked, MarkedOptions } from '@ts-stack/markdown' import type * as LSP from 'vscode-languageserver-protocol' import { isArray } from '../lib/utils' @@ -43,14 +43,18 @@ export function offsetToPos(doc: Text, offset: number) { } } +const markedOptions: MarkedOptions = { + gfm: true, +} + export function formatMarkdownContents( contents: LSP.MarkupContent | LSP.MarkedString | LSP.MarkedString[] ): string { if (isArray(contents)) { return contents.map((c) => formatMarkdownContents(c) + '\n\n').join('') } else if (typeof contents === 'string') { - return Marked.parse(contents) + return Marked.parse(contents, markedOptions) } else { - return Marked.parse(contents.value) + return Marked.parse(contents.value, markedOptions) } } diff --git a/src/wasm-lib/kcl/src/docs/gen_std_tests.rs b/src/wasm-lib/kcl/src/docs/gen_std_tests.rs index b4ca98425..790e24f0f 100644 --- a/src/wasm-lib/kcl/src/docs/gen_std_tests.rs +++ b/src/wasm-lib/kcl/src/docs/gen_std_tests.rs @@ -542,7 +542,7 @@ fn generate_function(internal_fn: Box) -> Result) -> fmt::Result { + f.write_str(&self.name)?; + if !self.required { + f.write_char('?')?; + } + f.write_str(": ")?; + f.write_str(&self.type_) + } +} + fn its_true() -> bool { true } @@ -419,20 +433,29 @@ pub trait StdLibFn: std::fmt::Debug + Send + Sync { }) } - fn fn_signature(&self) -> String { + fn fn_signature(&self, include_name: bool) -> String { let mut signature = String::new(); - signature.push_str(&format!("{}(", self.name())); - for (i, arg) in self.args(false).iter().enumerate() { - if i > 0 { - signature.push_str(", "); - } - if arg.required { - signature.push_str(&format!("{}: {}", arg.name, arg.type_)); - } else { - signature.push_str(&format!("{}?: {}", arg.name, arg.type_)); - } + if include_name { + signature.push_str(&self.name()); + } + + let args = self.args(false); + if args.is_empty() { + signature.push_str("()"); + } else if args.len() == 1 { + signature.push('('); + signature.push_str(&args[0].to_string()); + signature.push(')'); + } else { + signature.push('('); + for a in args { + signature.push_str("\n "); + signature.push_str(&a.to_string()); + signature.push(','); + } + signature.push('\n'); + signature.push(')'); } - signature.push(')'); if let Some(return_value) = self.return_value(false) { signature.push_str(&format!(" -> {}", return_value.type_)); } @@ -444,7 +467,7 @@ pub trait StdLibFn: std::fmt::Debug + Send + Sync { Ok(CompletionItem { label: self.name(), label_details: Some(CompletionItemLabelDetails { - detail: Some(self.fn_signature().replace(&self.name(), "")), + detail: Some(self.fn_signature(false)), description: None, }), kind: Some(CompletionItemKind::FUNCTION), diff --git a/src/wasm-lib/kcl/src/lsp/kcl/mod.rs b/src/wasm-lib/kcl/src/lsp/kcl/mod.rs index 9cb8c6b33..adafacc88 100644 --- a/src/wasm-lib/kcl/src/lsp/kcl/mod.rs +++ b/src/wasm-lib/kcl/src/lsp/kcl/mod.rs @@ -1048,7 +1048,7 @@ impl LanguageServer for Backend { contents: HoverContents::Markup(MarkupContent { kind: MarkupKind::Markdown, value: format!( - "```{}{}```\n{}", + "```\n{}{}\n```\n\n{}", name, if let Some(detail) = &label_details.detail { detail diff --git a/src/wasm-lib/kcl/src/lsp/tests.rs b/src/wasm-lib/kcl/src/lsp/tests.rs index 6afcf5289..ebf86ead8 100644 --- a/src/wasm-lib/kcl/src/lsp/tests.rs +++ b/src/wasm-lib/kcl/src/lsp/tests.rs @@ -902,10 +902,13 @@ async fn test_kcl_lsp_on_hover() { .unwrap(); // Check the hover. - if let Some(hover) = hover { - assert_eq!(hover.contents, tower_lsp::lsp_types::HoverContents::Markup(tower_lsp::lsp_types::MarkupContent { kind: tower_lsp::lsp_types::MarkupKind::Markdown, value: "```startSketchOn(data: SketchData, tag?: FaceTag) -> SketchSurface```\nStart a new 2-dimensional sketch on a specific plane or face.\n\n### Sketch on Face Behavior\n\nThere are some important behaviors to understand when sketching on a face:\n\nThe resulting sketch will _include_ the face and thus Solid that was sketched on. So say you were to export the resulting Sketch / Solid from a sketch on a face, you would get both the artifact of the sketch on the face and the parent face / Solid itself.\n\nThis is important to understand because if you were to then sketch on the resulting Solid, it would again include the face and parent Solid that was sketched on. This could go on indefinitely.\n\nThe point is if you want to export the result of a sketch on a face, you only need to export the final Solid that was created from the sketch on the face, since it will include all the parent faces and Solids.".to_string() })); - } else { - panic!("Expected hover"); + match hover.unwrap().contents { + tower_lsp::lsp_types::HoverContents::Markup(tower_lsp::lsp_types::MarkupContent { value, .. }) => { + value.contains("startSketchOn"); + value.contains("-> SketchSurface"); + value.contains("Start a new 2-dimensional sketch on a specific"); + } + _ => unreachable!(), } }