Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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.
16 changes: 14 additions & 2 deletions src/lang/KclSingleton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,20 @@ export class KclManager extends EventTarget {
}

setDiagnosticsForCurrentErrors() {
this.singletons.editorManager?.setDiagnostics(this.diagnostics)
this._diagnosticsCallback(this.diagnostics)
let diagnostics = this.diagnostics
const codeIsEmptyString = this.singletons.codeManager.code.trim() === ''
if (codeIsEmptyString && diagnostics.length > 0) {
/**
* If the current code is the empty string, why would there be diagnostics on an empty string?
* The entire editor should be cleared. It cannot have diagnostics for '' since we do not
* tell the user if the editor is completely blank.
*/
console.error('attempted diagnostics:', this.diagnostics)
diagnostics = []
}

this.singletons.editorManager?.setDiagnostics(diagnostics)
this._diagnosticsCallback(diagnostics)
}

get isExecuting() {
Expand Down
Loading