Selections Refactor (#4381)

* selection stuff

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)

* trigger CI

* fix bugs

* some edge cut stuff

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)

* trigger CI

* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores)

* fix sketch mode issues

* fix more tests, selection in sketch related

* more test fixing

* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores)

* Trigger ci

* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores)

* Trigger ci

* more sketch mode selection fixes

* fix unit tests

* rename function

* remove .only

* migrate a more selections types

* migrate a more selections types

* migrate a more selections types

* lint

* migrate a more selections types

* migrate a more selections types

* migrate a more selections types

* migrate a more selections types

* migrate a more selections types

* migrate a more selections types

* migrate a more selections types

* migrate a more selections types

* migrate a more selections types

* migrate a more selections types

* fix bad pathToNode issue

* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores)

* fix sketch on face

* migrate a more selections types

* migrate a more selections types

* fix code selection of fillets

* migrate a more selections types

* migrate a more selections types

* migrate a more selections types

* migrate a more selections types

* migrate a more selections types

* fix bad path to node, looks like a race

* migrate a more selections types

* migrate a more selections types

* fix cmd bar selections

* fix cmd bar selections

* fix display issues

* migrate a more selections types

* Revert "migrate a more selections types"

This reverts commit 0d0e453bbb.

* migrate a more selections types

* clean up1

* clean up 2

* fix types after main merge

* review tweaks

* fix wall selection bug

* Update src/lang/std/engineConnection.ts

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>

* add franks TODO comment

* fix type after main merge, plus a touch of clean up

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
This commit is contained in:
Kurt Hutten
2024-11-21 15:04:30 +11:00
committed by GitHub
parent c17cb1067f
commit 59e0df7879
49 changed files with 885 additions and 763 deletions

View File

@ -22,6 +22,7 @@ import { findUsesOfTagInPipe, getNodePathFromSourceRange } from './queryAst'
import { err } from 'lib/trap'
import { SimplifiedArgDetails } from './std/stdTypes'
import { Node } from 'wasm-lib/kcl/bindings/Node'
import { Artifact, codeRefFromRange } from './std/artifactGraph'
beforeAll(async () => {
await initPromise
@ -735,7 +736,7 @@ sketch003 = startSketchOn('XZ')
|> close(%)`,
codeAfter: `myVar = 5\n`,
lineOfInterest: 'line([-2.94, 2.7], %)',
type: 'default',
type: 'segment',
},
],
[
@ -761,7 +762,7 @@ const extrude001 = extrude(10, sketch001)`,
|> line([-17.67, 0.85], %)
|> close(%)\n`,
lineOfInterest: 'line([2.66, 1.17], %)',
type: 'extrude-wall',
type: 'wall',
},
],
[
@ -817,7 +818,7 @@ sketch002 = startSketchOn({
|> close(%)
`,
lineOfInterest: 'line([-11.18, -2.15], %)',
type: 'extrude-wall',
type: 'wall',
},
],
[
@ -873,7 +874,7 @@ sketch002 = startSketchOn({
|> close(%)
`,
lineOfInterest: 'startProfileAt([4.46, 5.12], %, $tag)',
type: 'end-cap',
type: 'cap',
},
],
] as const
@ -890,11 +891,12 @@ sketch002 = startSketchOn({
codeBefore.indexOf(lineOfInterest),
codeBefore.indexOf(lineOfInterest) + lineOfInterest.length,
]
const artifact = { type } as Artifact
const newAst = await deleteFromSelection(
ast,
{
range,
type,
codeRef: codeRefFromRange(range, ast),
artifact,
},
execState.memory,
async () => {