Revert multi-profile (#4812)
* Revert "multi-profile follow up. (#4802)" This reverts commit2b2ed470c1
. * Revert "multi profile (#4532)" This reverts commit04e586d07b
. * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores) * Re-run CI after snapshots * Re-run CI after snapshots * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest-8-cores) * Re-run CI after snapshots * Add `fixme` to onboarding test --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@ -280,19 +280,18 @@ export function getEventForSegmentSelection(
|
||||
}
|
||||
if (!id || !group) return null
|
||||
const artifact = engineCommandManager.artifactGraph.get(id)
|
||||
if (!artifact) return null
|
||||
const node = getNodeFromPath<Expr>(kclManager.ast, group.userData.pathToNode)
|
||||
if (err(node)) return null
|
||||
const codeRefs = getCodeRefsByArtifactId(
|
||||
id,
|
||||
engineCommandManager.artifactGraph
|
||||
)
|
||||
if (!artifact || !codeRefs) return null
|
||||
return {
|
||||
type: 'Set selection',
|
||||
data: {
|
||||
selectionType: 'singleCodeCursor',
|
||||
selection: {
|
||||
artifact,
|
||||
codeRef: {
|
||||
pathToNode: group?.userData?.pathToNode,
|
||||
range: [node.node.start, node.node.end, true],
|
||||
},
|
||||
codeRef: codeRefs[0],
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -676,7 +675,8 @@ export function getSelectionTypeDisplayText(
|
||||
const selectionsByType = getSelectionCountByType(selection)
|
||||
if (selectionsByType === 'none') return null
|
||||
|
||||
return [...selectionsByType.entries()]
|
||||
return selectionsByType
|
||||
.entries()
|
||||
.map(
|
||||
// Hack for showing "face" instead of "extrude-wall" in command bar text
|
||||
([type, count]) =>
|
||||
@ -685,6 +685,7 @@ export function getSelectionTypeDisplayText(
|
||||
.replace('solid2D', 'face')
|
||||
.replace('segment', 'face')}${count > 1 ? 's' : ''}`
|
||||
)
|
||||
.toArray()
|
||||
.join(', ')
|
||||
}
|
||||
|
||||
@ -694,7 +695,7 @@ export function canSubmitSelectionArg(
|
||||
) {
|
||||
return (
|
||||
selectionsByType !== 'none' &&
|
||||
[...selectionsByType.entries()].every(([type, count]) => {
|
||||
selectionsByType.entries().every(([type, count]) => {
|
||||
const foundIndex = argument.selectionTypes.findIndex((s) => s === type)
|
||||
return (
|
||||
foundIndex !== -1 &&
|
||||
@ -717,7 +718,7 @@ export function codeToIdSelections(
|
||||
// TODO #868: loops over all artifacts will become inefficient at a large scale
|
||||
const overlappingEntries = Array.from(engineCommandManager.artifactGraph)
|
||||
.map(([id, artifact]) => {
|
||||
if (!('codeRef' in artifact && artifact.codeRef)) return null
|
||||
if (!('codeRef' in artifact)) return null
|
||||
return isOverlap(artifact.codeRef.range, selection.range)
|
||||
? {
|
||||
artifact,
|
||||
@ -960,6 +961,7 @@ export function updateSelections(
|
||||
JSON.stringify(pathToNode)
|
||||
) {
|
||||
artifact = a
|
||||
console.log('found artifact', a)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user