don't allow edit on sketches with no variable declaration (#3292)
don't allow edit on sketches with no variable decleration
This commit is contained in:
@ -791,6 +791,7 @@ export function isSingleCursorInPipe(
|
||||
const pathToNode = getNodePathFromSourceRange(ast, selection.range)
|
||||
const nodeTypes = pathToNode.map(([, type]) => type)
|
||||
if (nodeTypes.includes('FunctionExpression')) return false
|
||||
if (!nodeTypes.includes('VariableDeclaration')) return false
|
||||
if (nodeTypes.includes('PipeExpression')) return true
|
||||
return false
|
||||
}
|
||||
|
Reference in New Issue
Block a user