Update point-and-click sketch close code generation to use explicit lines (#2489)

* Modify sketch profile completion to use `profileStart` utilties

* Fix up playwright tests

* Rerun CI
This commit is contained in:
Frank Noirot
2024-05-23 00:53:15 -04:00
committed by GitHub
parent 0a7f1a41fc
commit 25f18845c7
3 changed files with 67 additions and 8 deletions

View File

@ -1114,6 +1114,28 @@ export function addNewSketchLn({
})
}
export function addCallExpressionsToPipe({
node,
pathToNode,
expressions,
}: {
node: Program
programMemory: ProgramMemory
pathToNode: PathToNode
expressions: CallExpression[]
}) {
const _node = { ...node }
const pipeExpression = getNodeFromPath<PipeExpression>(
_node,
pathToNode,
'PipeExpression'
).node
if (pipeExpression.type !== 'PipeExpression')
throw new Error('not a pipe expression')
pipeExpression.body = [...pipeExpression.body, ...expressions]
return _node
}
export function addCloseToPipe({
node,
pathToNode,