Add automatic syntax checker, fix editor bugs

This commit is contained in:
Nilay Majorwar
2022-01-22 21:22:38 +05:30
parent dbccab5244
commit 94dce5bfa9
12 changed files with 163 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
import { DocumentRange, StepExecutionResult } from "./types";
import { StepExecutionResult } from "./types";
import * as E from "./worker-errors";
/** Types of requests the worker handles */
@@ -19,6 +19,10 @@ export type WorkerRequestData =
type: "UpdateBreakpoints";
params: { points: number[] };
}
| {
type: "ValidateCode";
params: { code: string };
}
| {
type: "Execute";
params: { interval: number };
@@ -57,6 +61,11 @@ export type WorkerResponseData<RS, A extends WorkerAckType> =
data: A;
error?: WorkerAckError[A];
}
/** Result of code validation, containing parsing error (if any) */
| {
type: "validate";
error?: E.WorkerParseError;
}
/** Response containing step execution result, and runtime error (if any) */
| {
type: "result";