Fix: make Toolbar components support CallExpressionKw
This commit is contained in:
committed by
Nick Cameron
parent
12ed315244
commit
da3788afba
@ -57,7 +57,7 @@ export function equalAngleInfo({
|
|||||||
)
|
)
|
||||||
const isAllTooltips = nodes.every(
|
const isAllTooltips = nodes.every(
|
||||||
(node) =>
|
(node) =>
|
||||||
node?.type === 'CallExpression' &&
|
(node?.type === 'CallExpression' || node?.type === 'CallExpressionKw') &&
|
||||||
toolTips.includes(node.callee.name as any)
|
toolTips.includes(node.callee.name as any)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -52,7 +52,7 @@ export function setEqualLengthInfo({
|
|||||||
)
|
)
|
||||||
const isAllTooltips = nodes.every(
|
const isAllTooltips = nodes.every(
|
||||||
(node) =>
|
(node) =>
|
||||||
node?.type === 'CallExpression' &&
|
(node?.type === 'CallExpression' || node?.type === 'CallExpressionKw') &&
|
||||||
toolTips.includes(node.callee.name as any)
|
toolTips.includes(node.callee.name as any)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@ export function horzVertInfo(
|
|||||||
|
|
||||||
const isAllTooltips = nodes.every(
|
const isAllTooltips = nodes.every(
|
||||||
(node) =>
|
(node) =>
|
||||||
node?.type === 'CallExpression' &&
|
(node?.type === 'CallExpression' || node?.type === 'CallExpressionKw') &&
|
||||||
toolTips.includes(node.callee.name as any)
|
toolTips.includes(node.callee.name as any)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -98,7 +98,7 @@ export function intersectInfo({
|
|||||||
)
|
)
|
||||||
const isAllTooltips = nodes.every(
|
const isAllTooltips = nodes.every(
|
||||||
(node) =>
|
(node) =>
|
||||||
node?.type === 'CallExpression' &&
|
(node?.type === 'CallExpression' || node?.type === 'CallExpressionKw') &&
|
||||||
[
|
[
|
||||||
...toolTips,
|
...toolTips,
|
||||||
'startSketchAt', // TODO probably a better place for this to live
|
'startSketchAt', // TODO probably a better place for this to live
|
||||||
|
|||||||
@ -50,7 +50,7 @@ export function removeConstrainingValuesInfo({
|
|||||||
: selectionRanges
|
: selectionRanges
|
||||||
const isAllTooltips = nodes.every(
|
const isAllTooltips = nodes.every(
|
||||||
(node) =>
|
(node) =>
|
||||||
node?.type === 'CallExpression' &&
|
(node?.type === 'CallExpression' || node?.type === 'CallExpressionKw') &&
|
||||||
toolTips.includes(node.callee.name as any)
|
toolTips.includes(node.callee.name as any)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -45,11 +45,10 @@ export function absDistanceInfo({
|
|||||||
? 'xAbs'
|
? 'xAbs'
|
||||||
: 'yAbs'
|
: 'yAbs'
|
||||||
const _nodes = selectionRanges.graphSelections.map(({ codeRef }) => {
|
const _nodes = selectionRanges.graphSelections.map(({ codeRef }) => {
|
||||||
const tmp = getNodeFromPath<Expr>(
|
const tmp = getNodeFromPath<Expr>(kclManager.ast, codeRef.pathToNode, [
|
||||||
kclManager.ast,
|
'CallExpression',
|
||||||
codeRef.pathToNode,
|
'CallExpressionKw',
|
||||||
'CallExpression'
|
])
|
||||||
)
|
|
||||||
if (err(tmp)) return tmp
|
if (err(tmp)) return tmp
|
||||||
return tmp.node
|
return tmp.node
|
||||||
})
|
})
|
||||||
@ -59,7 +58,7 @@ export function absDistanceInfo({
|
|||||||
|
|
||||||
const isAllTooltips = nodes.every(
|
const isAllTooltips = nodes.every(
|
||||||
(node) =>
|
(node) =>
|
||||||
node?.type === 'CallExpression' &&
|
(node?.type === 'CallExpression' || node?.type === 'CallExpressionKw') &&
|
||||||
toolTips.includes(node.callee.name as any)
|
toolTips.includes(node.callee.name as any)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -57,7 +57,7 @@ export function angleBetweenInfo({
|
|||||||
)
|
)
|
||||||
const isAllTooltips = nodes.every(
|
const isAllTooltips = nodes.every(
|
||||||
(node) =>
|
(node) =>
|
||||||
node?.type === 'CallExpression' &&
|
(node?.type === 'CallExpression' || node?.type === 'CallExpressionKw') &&
|
||||||
toolTips.includes(node.callee.name as any)
|
toolTips.includes(node.callee.name as any)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -61,7 +61,7 @@ export function horzVertDistanceInfo({
|
|||||||
)
|
)
|
||||||
const isAllTooltips = nodes.every(
|
const isAllTooltips = nodes.every(
|
||||||
(node) =>
|
(node) =>
|
||||||
node?.type === 'CallExpression' &&
|
(node?.type === 'CallExpression' || node?.type === 'CallExpressionKw') &&
|
||||||
[
|
[
|
||||||
...toolTips,
|
...toolTips,
|
||||||
'startSketchAt', // TODO probably a better place for this to live
|
'startSketchAt', // TODO probably a better place for this to live
|
||||||
|
|||||||
Reference in New Issue
Block a user