diff --git a/src/lang/queryAst.ts b/src/lang/queryAst.ts index 3a2dea259e..d89d7b1c86 100644 --- a/src/lang/queryAst.ts +++ b/src/lang/queryAst.ts @@ -1045,10 +1045,9 @@ export function getSketchExprsFromSelection( nodeToEdit?: PathToNode ): Error | Expr[] { const sketches: Expr[] = selection.graphSelections.flatMap((s) => { - const path = getNodePathFromSourceRange(ast, s?.codeRef.range) const sketchVariable = getNodeFromPath( ast, - path, + s?.codeRef.pathToNode, 'VariableDeclarator' ) if (err(sketchVariable)) {