diff --git a/src/lang/queryAst.ts b/src/lang/queryAst.ts index 64b057a096..2f74254a32 100644 --- a/src/lang/queryAst.ts +++ b/src/lang/queryAst.ts @@ -1074,10 +1074,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)) {