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:
@ -1,10 +1,7 @@
|
||||
import { toolTips } from 'lang/langHelpers'
|
||||
import { Selections } from 'lib/selections'
|
||||
import { Program, Expr } from '../../lang/wasm'
|
||||
import {
|
||||
getNodePathFromSourceRange,
|
||||
getNodeFromPath,
|
||||
} from '../../lang/queryAst'
|
||||
import { Selections } from 'lib/selections'
|
||||
import { getNodeFromPath } from '../../lang/queryAst'
|
||||
import {
|
||||
getTransformInfos,
|
||||
transformAstSketchLines,
|
||||
@ -47,13 +44,10 @@ export function absDistanceInfo({
|
||||
: constraint === 'snapToYAxis'
|
||||
? 'xAbs'
|
||||
: 'yAbs'
|
||||
const paths = selectionRanges.codeBasedSelections.map(({ range }) =>
|
||||
getNodePathFromSourceRange(kclManager.ast, range)
|
||||
)
|
||||
const _nodes = paths.map((pathToNode) => {
|
||||
const _nodes = selectionRanges.graphSelections.map(({ codeRef }) => {
|
||||
const tmp = getNodeFromPath<Expr>(
|
||||
kclManager.ast,
|
||||
pathToNode,
|
||||
codeRef.pathToNode,
|
||||
'CallExpression'
|
||||
)
|
||||
if (err(tmp)) return tmp
|
||||
@ -84,7 +78,7 @@ export function absDistanceInfo({
|
||||
const enabled =
|
||||
isAllTooltips &&
|
||||
transforms.every(Boolean) &&
|
||||
selectionRanges.codeBasedSelections.length === 1 &&
|
||||
selectionRanges.graphSelections.length === 1 &&
|
||||
(enableX || enableY)
|
||||
|
||||
return { enabled, transforms }
|
||||
@ -109,7 +103,7 @@ export async function applyConstraintAbsDistance({
|
||||
|
||||
const transform1 = transformAstSketchLines({
|
||||
ast: structuredClone(kclManager.ast),
|
||||
selectionRanges: selectionRanges,
|
||||
selectionRanges,
|
||||
transformInfos,
|
||||
programMemory: kclManager.programMemory,
|
||||
referenceSegName: '',
|
||||
@ -129,7 +123,7 @@ export async function applyConstraintAbsDistance({
|
||||
|
||||
const transform2 = transformAstSketchLines({
|
||||
ast: structuredClone(kclManager.ast),
|
||||
selectionRanges: selectionRanges,
|
||||
selectionRanges,
|
||||
transformInfos,
|
||||
programMemory: kclManager.programMemory,
|
||||
referenceSegName: '',
|
||||
@ -177,7 +171,7 @@ export function applyConstraintAxisAlign({
|
||||
|
||||
return transformAstSketchLines({
|
||||
ast: structuredClone(kclManager.ast),
|
||||
selectionRanges: selectionRanges,
|
||||
selectionRanges,
|
||||
transformInfos,
|
||||
programMemory: kclManager.programMemory,
|
||||
referenceSegName: '',
|
||||
|
||||
Reference in New Issue
Block a user