Refactor Edge Treatment Module to Break Cyclic Dependency (#5243)

* break cycle

* yarn fmt
This commit is contained in:
max
2025-02-04 01:14:53 +01:00
committed by GitHub
parent 86349375d0
commit 25ad603502
4 changed files with 111 additions and 26 deletions

View File

@ -19,17 +19,28 @@ import {
createVariableDeclaration,
} from 'lang/modifyAst'
import { KCL_DEFAULT_CONSTANT_PREFIXES } from 'lib/constants'
import { KclManager } from 'lang/KclSingleton'
import { EngineCommandManager } from 'lang/std/engineConnection'
import EditorManager from 'editor/manager'
import CodeManager from 'lang/codeManager'
export function addShell({
node,
selection,
artifactGraph,
thickness,
dependencies,
}: {
node: Node<Program>
selection: Selections
artifactGraph: ArtifactGraph
thickness: Expr
dependencies: {
kclManager: KclManager
engineCommandManager: EngineCommandManager
editorManager: EditorManager
codeManager: CodeManager
}
}): Error | { modifiedAst: Node<Program>; pathToNode: PathToNode } {
const modifiedAst = structuredClone(node)
@ -42,7 +53,8 @@ export function addShell({
const extrudeLookupResult = getPathToExtrudeForSegmentSelection(
clonedAstForGetExtrude,
graphSelection,
artifactGraph
artifactGraph,
dependencies
)
if (err(extrudeLookupResult)) {
return new Error("Couldn't find extrude")