import { DebugProtocol } from "@vscode/debugprotocol"
import { handle_request } from "../request-handler";
import { Command } from "../types";

onmessage = (event: MessageEvent) => {
  const request: DebugProtocol.Request = event.data;
  if (request != null && Object.values(Command).includes(request.command as Command)) {
    handle_request(request).then(
      (res) => {
        postMessage(res);
      }
    );
  }
};

