OXYGENHUB
◆ main spectra-vscode / test / vscode-stub.mjs
615 B · last changed Spectra for VS Code 0.1: set up and chat without the command line (#6) 1 day ago source blame history raw
1
// The little of the vscode module the bridge and the model use, for the
2
// smoke test under plain Node.
3
export class EventEmitter {
4
  constructor() { this.listeners = []; this.event = (l) => { this.listeners.push(l); return { dispose: () => {} }; }; }
5
  fire(v) { for (const l of this.listeners) l(v); }
6
  dispose() { this.listeners = []; }
7
}
8
export class Disposable { constructor(f) { this.f = f; } dispose() { this.f?.(); } }
9
export const workspace = { getConfiguration: () => ({ get: (k) => (k === "path" ? process.env.SPECTRA_BIN || "" : undefined) }), workspaceFolders: undefined };
10
export const window = {};