Move artifact graph out of engine connection (#6062)
* cleanups Signed-off-by: Jess Frazelle <github@jessfraz.com> * cleanups Signed-off-by: Jess Frazelle <github@jessfraz.com> * fmt Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
@ -566,7 +566,7 @@ export const ModelingMachineProvider = ({
|
||||
// See if the selection is "close enough" to be coerced to the plane later
|
||||
const maybePlane = getPlaneFromArtifact(
|
||||
selectionRanges.graphSelections[0].artifact,
|
||||
engineCommandManager.artifactGraph
|
||||
kclManager.artifactGraph
|
||||
)
|
||||
return !err(maybePlane)
|
||||
}
|
||||
@ -579,7 +579,7 @@ export const ModelingMachineProvider = ({
|
||||
return false
|
||||
}
|
||||
return !!isCursorInSketchCommandRange(
|
||||
engineCommandManager.artifactGraph,
|
||||
kclManager.artifactGraph,
|
||||
selectionRanges
|
||||
)
|
||||
},
|
||||
@ -841,7 +841,7 @@ export const ModelingMachineProvider = ({
|
||||
const artifact = selectionRanges.graphSelections[0].artifact
|
||||
const plane = getPlaneFromArtifact(
|
||||
artifact,
|
||||
engineCommandManager.artifactGraph
|
||||
kclManager.artifactGraph
|
||||
)
|
||||
if (err(plane)) return Promise.reject(plane)
|
||||
// if the user selected a segment, make sure we enter the right sketch as there can be multiple on a plane
|
||||
@ -917,14 +917,13 @@ export const ModelingMachineProvider = ({
|
||||
info?.sketchDetails?.faceId || ''
|
||||
)
|
||||
|
||||
const sketchArtifact =
|
||||
engineCommandManager.artifactGraph.get(mainPath)
|
||||
const sketchArtifact = kclManager.artifactGraph.get(mainPath)
|
||||
if (sketchArtifact?.type !== 'path')
|
||||
return Promise.reject(new Error('No sketch artifact'))
|
||||
const sketchPaths = getPathsFromArtifact({
|
||||
artifact: engineCommandManager.artifactGraph.get(plane.id),
|
||||
artifact: kclManager.artifactGraph.get(plane.id),
|
||||
sketchPathToNode: sketchArtifact?.codeRef?.pathToNode,
|
||||
artifactGraph: engineCommandManager.artifactGraph,
|
||||
artifactGraph: kclManager.artifactGraph,
|
||||
ast: kclManager.ast,
|
||||
})
|
||||
if (err(sketchPaths)) return Promise.reject(sketchPaths)
|
||||
@ -1743,7 +1742,7 @@ export const ModelingMachineProvider = ({
|
||||
prompt: input.prompt,
|
||||
selections: input.selection,
|
||||
token,
|
||||
artifactGraph: engineCommandManager.artifactGraph,
|
||||
artifactGraph: kclManager.artifactGraph,
|
||||
projectName: context.project.name,
|
||||
})
|
||||
}),
|
||||
|
Reference in New Issue
Block a user