Skip to content
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
980e3a5
Only show axis planes when there are no errors
andrewvarga Mar 13, 2025
57d69eb
run prettier
andrewvarga Mar 13, 2025
f294ef0
Merge branch 'main' into andrewvarga/5783/errors-can-cause-default-pl…
andrewvarga Mar 13, 2025
11bda0a
Merge branch 'main' into andrewvarga/5783/errors-can-cause-default-pl…
andrewvarga Mar 14, 2025
76a9dac
Merge branch 'main' into andrewvarga/5783/errors-can-cause-default-pl…
andrewvarga Mar 14, 2025
79ed12e
Merge branch 'main' into andrewvarga/5783/errors-can-cause-default-pl…
andrewvarga Mar 14, 2025
be6a6e1
Merge branch 'main' into andrewvarga/5783/errors-can-cause-default-pl…
andrewvarga Mar 17, 2025
6b3d63b
Merge branch 'main' into andrewvarga/5783/errors-can-cause-default-pl…
andrewvarga Mar 18, 2025
f860f3f
Merge branch 'main' into andrewvarga/5783/errors-can-cause-default-pl…
andrewvarga Mar 18, 2025
f18b2de
merge main
andrewvarga Mar 18, 2025
125ddab
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 18, 2025
e559779
KclSingleton hasErrors refactor
andrewvarga Mar 18, 2025
12d2795
merge main
andrewvarga Mar 18, 2025
2998a0b
merge from main
andrewvarga Mar 18, 2025
0a302df
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 18, 2025
41cb12e
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 18, 2025
9399cd1
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 18, 2025
e6b9340
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 18, 2025
d9410ec
merge from main
andrewvarga Mar 19, 2025
07070f1
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 19, 2025
0bfd37a
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 19, 2025
7031cc8
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 19, 2025
4e39d44
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 19, 2025
eb0d651
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 19, 2025
bae9238
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 19, 2025
86a852f
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 19, 2025
a3c2c06
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 19, 2025
2046812
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 19, 2025
b0cf1e0
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 19, 2025
96d4d02
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 19, 2025
3627331
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 19, 2025
9014765
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 19, 2025
ff59f85
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 19, 2025
b97d781
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 19, 2025
5f53620
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 19, 2025
b477b6e
Merge branch 'main' into andrewvarga/5783/errors-can-cause-default-pl…
andrewvarga Mar 19, 2025
d3d48a1
merge from main
andrewvarga Mar 20, 2025
c2d6638
Merge branch 'main' into andrewvarga/5783/errors-can-cause-default-pl…
andrewvarga Mar 20, 2025
51d6439
merge main
andrewvarga Mar 20, 2025
8c72cae
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 20, 2025
f894d0b
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 20, 2025
3a54d51
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 20, 2025
63ffc17
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 20, 2025
2d9fc5b
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 20, 2025
29319a7
Merge branch 'main' into andrewvarga/5783/errors-can-cause-default-pl…
andrewvarga Mar 20, 2025
dc8d802
Merge branch 'main' into andrewvarga/5783/errors-can-cause-default-pl…
andrewvarga Mar 20, 2025
b3e75ed
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 20, 2025
afdfd73
A snapshot a day keeps the bugs away! 📷🐛
github-actions[bot] Mar 20, 2025
72631a4
merge from main
andrewvarga Mar 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions src/lang/KclSingleton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class KclManager {
private _isExecuting = false
private _executeIsStale: ExecuteArgs | null = null
private _wasmInitFailed = true
private _hasErrors = false
private _astParseFailed = false
private _switchedFiles = false
private _fileSettings: KclSettingsAnnotation = {}
private _kclVersion: string | undefined = undefined
Expand Down Expand Up @@ -167,7 +167,7 @@ export class KclManager {
}

hasErrors(): boolean {
return this._hasErrors
return this._astParseFailed || this._errors.length > 0
}

setDiagnosticsForCurrentErrors() {
Expand Down Expand Up @@ -278,7 +278,7 @@ export class KclManager {
private async checkIfSwitchedFilesShouldClear() {
// If we were switching files and we hit an error on parse we need to bust
// the cache and clear the scene.
if (this._hasErrors && this._switchedFiles) {
if (this._astParseFailed && this._switchedFiles) {
await rustContext.clearSceneAndBustCache(
{ settings: await jsAppSettings() },
codeManager.currentFilePath || undefined
Expand All @@ -292,12 +292,12 @@ export class KclManager {
async safeParse(code: string): Promise<Node<Program> | null> {
const result = parse(code)
this.diagnostics = []
this._hasErrors = false
this._astParseFailed = false

if (err(result)) {
const kclerror: KCLError = result as KCLError
this.diagnostics = kclErrorsToDiagnostics([kclerror])
this._hasErrors = true
this._astParseFailed = true

await this.checkIfSwitchedFilesShouldClear()
return null
Expand All @@ -313,7 +313,7 @@ export class KclManager {
this.addDiagnostics(complilationErrorsToDiagnostics(result.errors))
this.addDiagnostics(complilationErrorsToDiagnostics(result.warnings))
if (result.errors.length > 0) {
this._hasErrors = true
this._astParseFailed = true

await this.checkIfSwitchedFilesShouldClear()
return null
Expand Down
8 changes: 7 additions & 1 deletion src/machines/modelingMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,9 @@ export const modelingMachine = setup({
'Selection is on face': () => false,
'Has exportable geometry': () => false,
'has valid selection for deletion': () => false,
'no kcl errors': () => {
return !kclManager.hasErrors()
},
'is editing existing sketch': ({ context: { sketchDetails } }) =>
isEditingExistingSketch({ sketchDetails }),
'Can make selection horizontal': ({ context: { selectionRanges } }) => {
Expand Down Expand Up @@ -2620,7 +2623,10 @@ export const modelingMachine = setup({
states: {
hidePlanes: {
on: {
'Artifact graph populated': 'showPlanes',
'Artifact graph populated': {
target: 'showPlanes',
guard: 'no kcl errors',
},
},

entry: 'hide default planes',
Expand Down