diff --git a/e2e/playwright/testing-selections.spec.ts b/e2e/playwright/testing-selections.spec.ts index f6dcde9a9..b0fc5b987 100644 --- a/e2e/playwright/testing-selections.spec.ts +++ b/e2e/playwright/testing-selections.spec.ts @@ -646,14 +646,14 @@ test.describe('Testing selections', () => { await checkCodeAtHoverPosition( 'flatExtrusionFace', flatExtrusionFace, - `angledLineThatIntersects({angle=3.14,intersectTag=a,offset=0},%)extrude(5+7,%)`, + `angledLineThatIntersects({angle=3.14,intersectTag=a,offset=0},%)extrude(length=5+7)`, '}, %)' ) await checkCodeAtHoverPosition( 'tangentialArcTo', tangentialArcTo, - 'tangentialArcTo([13.14+0,13.14],%)extrude(5+7,%)', + 'tangentialArcTo([13.14+0,13.14],%)extrude(length=5+7)', 'tangentialArcTo([13.14 + 0, 13.14], %)' ) await checkCodeAtHoverPosition( @@ -678,15 +678,10 @@ test.describe('Testing selections', () => { await checkCodeAtHoverPosition( 'close', close, - 'close()extrude(5+7,%)', - 'close()' - ) - await checkCodeAtHoverPosition( - 'closeEdge', - closeEdge, - `close()`, + 'close()extrude(length=5+7)', 'close()' ) + await checkCodeAtHoverPosition('closeEdge', closeEdge, `close()`, 'close()') await checkCodeAtHoverPosition( 'closeAdjacentEdge', closeAdjacentEdge, diff --git a/src/wasm-lib/kcl/src/lsp/copilot/mod.rs b/src/wasm-lib/kcl/src/lsp/copilot/mod.rs index fff8e7a7b..781bda560 100644 --- a/src/wasm-lib/kcl/src/lsp/copilot/mod.rs +++ b/src/wasm-lib/kcl/src/lsp/copilot/mod.rs @@ -272,7 +272,7 @@ impl Backend { } const part001 = cube([0,0], 20) |> close(%) - |> extrude(20, %)"# + |> extrude(length=20)"# .to_string(), ); } diff --git a/src/wasm-lib/kcl/src/lsp/tests.rs b/src/wasm-lib/kcl/src/lsp/tests.rs index 600a75af6..f6dd7565d 100644 --- a/src/wasm-lib/kcl/src/lsp/tests.rs +++ b/src/wasm-lib/kcl/src/lsp/tests.rs @@ -3335,7 +3335,7 @@ part001 = startSketchOn('XY') |> line(end = [0, 20], tag = $seg01) |> line(end = [-20, 0], tag = $seg01) |> close() - |> ^^^extrude(3.14, %)"#; + |> ^^^extrude(length = 3.14)"#; // Send open file. server diff --git a/src/wasm-lib/kcl/src/parsing/parser.rs b/src/wasm-lib/kcl/src/parsing/parser.rs index 952d5c29f..3ebd9ebc5 100644 --- a/src/wasm-lib/kcl/src/parsing/parser.rs +++ b/src/wasm-lib/kcl/src/parsing/parser.rs @@ -3731,7 +3731,7 @@ firstExtrude = startSketchOn('XY') |> line([20, 0], %) |> line([0, -8], %) |> close(%) - |> extrude(2, %) + |> extrude(length=2) secondExtrude = startSketchOn('XY') |> startProfileAt([0,0], %) @@ -4208,7 +4208,7 @@ let other_thing = 2 * cos(3)"#; |> line([w, 0], %) |> line([0, -l], %) |> close(%) - |> extrude(h, %) + |> extrude(length=h) return myBox } @@ -4509,7 +4509,7 @@ mod snapshot_tests { |> line([0, 10], %) |> tangentialArc([-5, 5], %) |> line([5, -15], %) - |> extrude(10, %) + |> extrude(length=10) "# ); snapshot_test!(b, "myVar = min(5 , -legLen(5, 4))"); // Space before comma diff --git a/src/wasm-lib/kcl/tests/artifact_graph_example_code1/input.kcl b/src/wasm-lib/kcl/tests/artifact_graph_example_code1/input.kcl index ecfc0a42d..11310bab2 100644 --- a/src/wasm-lib/kcl/tests/artifact_graph_example_code1/input.kcl +++ b/src/wasm-lib/kcl/tests/artifact_graph_example_code1/input.kcl @@ -13,4 +13,4 @@ sketch002 = startSketchOn(extrude001, seg02) |> line([2, -3], %) |> lineTo([profileStartX(%), profileStartY(%)], %) |> close(%) -extrude002 = extrude(5, sketch002) +extrude002 = extrude(sketch002, length = 5) diff --git a/src/wasm-lib/kcl/tests/artifact_graph_sketch_on_face_etc/input.kcl b/src/wasm-lib/kcl/tests/artifact_graph_sketch_on_face_etc/input.kcl index 22b3786a9..8b623780d 100644 --- a/src/wasm-lib/kcl/tests/artifact_graph_sketch_on_face_etc/input.kcl +++ b/src/wasm-lib/kcl/tests/artifact_graph_sketch_on_face_etc/input.kcl @@ -4,25 +4,25 @@ sketch001 = startSketchOn('XZ') |> line([5, -8], %, $seg01) |> lineTo([profileStartX(%), profileStartY(%)], %) |> close(%) -extrude001 = extrude(6, sketch001) +extrude001 = extrude(sketch001, length = 6) sketch002 = startSketchOn(extrude001, seg01) |> startProfileAt([-0.5, 0.5], %) |> line([2, 5], %) |> line([2, -5], %) |> lineTo([profileStartX(%), profileStartY(%)], %) |> close(%) -extrude002 = extrude(5, sketch002) +extrude002 = extrude(sketch002, length = 5) sketch003 = startSketchOn(extrude002, 'END') |> startProfileAt([1, 1.5], %) |> line([0.5, 2], %, $seg02) |> line([1, -2], %) |> lineTo([profileStartX(%), profileStartY(%)], %) |> close(%) -extrude003 = extrude(4, sketch003) +extrude003 = extrude(sketch002, length = 4) sketch004 = startSketchOn(extrude003, seg02) |> startProfileAt([-3, 14], %) |> line([0.5, 1], %) |> line([0.5, -2], %) |> lineTo([profileStartX(%), profileStartY(%)], %) |> close(%) -extrude004 = extrude(3, sketch004) +extrude004 = extrude(sketch002, length = 3)