Skip to content

Commit

Permalink
JS: Point-and-click should generate kwarg calls
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchalmers committed Feb 14, 2025
1 parent b866aef commit 613d9e6
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/lang/modifyAst/addEdgeTreatment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import {
createArrayExpression,
createIdentifier,
createPipeExpression,
createCallExpressionStdLibKw,
createLabeledArg,
} from '../modifyAst'
import {
getNodeFromPath,
Expand Down Expand Up @@ -166,13 +168,14 @@ export function modifyAstWithEdgeTreatmentAndTag(
const firstTag = tagCalls[0] // can be Identifier or CallExpression (for opposite and adjacent edges)

// edge treatment call
const edgeTreatmentCall = createCallExpressionStdLib(parameters.type, [
createObjectExpression({
[parameterName]: parameterValue,
tags: createArrayExpression(tagCalls),
}),
createPipeSubstitution(),
])
const edgeTreatmentCall = createCallExpressionStdLibKw(
parameters.type,
null,
[
createLabeledArg('tags', createArrayExpression(tagCalls)),
createLabeledArg(parameterName, parameterValue),
]
)

// Locate the extrude call
const locatedExtrudeDeclarator = locateExtrudeDeclarator(
Expand Down

0 comments on commit 613d9e6

Please sign in to comment.