Clean pu
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
@ -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'
|
||||
|
||||
Reference in New Issue
Block a user