This commit is contained in:
Pierre Jacquier
2025-07-04 07:47:07 -04:00
parent 78f885c3d1
commit 6a9870b6f3
2 changed files with 0 additions and 22 deletions

View File

@ -74,23 +74,3 @@ export async function stringToKclExpression(value: string) {
valueText: value,
} satisfies KclExpression
}
export async function retrieveArgFromPipedCallExpression(
callExpression: CallExpressionKw,
name: string
): Promise<KclCommandValue | undefined> {
const arg = callExpression.arguments.find(
(a) => a.label?.type === 'Identifier' && a.label?.name === name
)
if (
arg?.type === 'LabeledArg' &&
(arg.arg.type === 'Name' || arg.arg.type === 'Literal')
) {
const value = arg.arg.type === 'Name' ? arg.arg.name.name : arg.arg.raw
const result = await stringToKclExpression(value)
if (!(err(result) || 'errors' in result)) {
return result
}
}
return undefined
}

View File

@ -3,7 +3,6 @@ import type { OpKclValue, Operation } from '@rust/kcl-lib/bindings/Operation'
import type { CustomIconName } from '@src/components/CustomIcon'
import {
getNodeFromPath,
findPipesWithImportAlias,
getSketchSelectionsFromOperation,
getObjectSelectionsFromOperation,
} from '@src/lang/queryAst'
@ -29,7 +28,6 @@ import type {
import type { KclCommandValue, KclExpression } from '@src/lib/commandTypes'
import {
stringToKclExpression,
retrieveArgFromPipedCallExpression,
} from '@src/lib/kclHelpers'
import { isDefaultPlaneStr } from '@src/lib/planes'
import type { Selection, Selections } from '@src/lib/selections'