code-server-2/packages/vscode/src/client.ts

22 lines
884 B
TypeScript
Raw Normal View History

import { IdeClient } from "@coder/ide";
import * as paths from "./fill/paths";
2019-01-19 00:04:24 +00:00
import "./vscode.scss";
// NOTE: shouldn't import anything from VS Code here or anything that will
// depend on a synchronous fill like `os`.
2019-01-30 21:40:01 +00:00
class VSClient extends IdeClient {
protected initialize(): Promise<void> {
return this.task("Start workbench", 1000, async (data, sharedData) => {
paths._paths.initialize(data, sharedData);
process.env.SHELL = data.shell;
// At this point everything should be filled, including `os`. `os` also
// relies on `initData` but it listens first so it initialize before this
// callback, meaning we are safe to include everything from VS Code now.
const { workbench } = require("./workbench") as typeof import("./workbench");
await workbench.initialize();
}, this.initData, this.sharedProcessData);
}
}
export const client = new VSClient();