vscodePlugin

tcmts.cli.test.e2e.ts_plugin.vscodePlugin · #opwh25cb · term · runs on the server

uses node:path

The VS Code extension's TypeScript plugin (vscode/files/plugin).

import { tempDir } from "#codebase/tcmts/cli/test/e2e/harness";
import type { Plugin } from "#codebase/tcmts/cli/test/e2e/ts_plugin";
import { TS_PLUGIN } from "#codebase/tcmts/fixtures";
import fs from "node:fs";
import { createRequire } from "node:module";
import path from "node:path";

export function vscodePlugin(): Plugin {
  const file = path.join(tempDir("ts plugin"), "index.js");
  fs.writeFileSync(file, TS_PLUGIN);
  return createRequire(file)(file) as Plugin;
}

uses

used by