diff --git a/tooling/zed-rx/README.md b/tooling/zed-rx/README.md index 1cf8ebc4..77ca4e4d 100644 --- a/tooling/zed-rx/README.md +++ b/tooling/zed-rx/README.md @@ -113,3 +113,22 @@ default: ```json { "languages": { "ReactiveScript": { "semantic_tokens": "combined" } } } ``` + +## Tasks + +The extension adds two tasks, offered in **task: spawn** while a `.rx` file is +active: `rx-tsc: type-check project` and its `--watch` variant. Each runs +`npx --no rx-tsc --noEmit` in the worktree root. `--no` installs nothing; +without the package, npm reports a 404 for `rx-tsc`. + +Requirements: + +- `node` and `npx` on the `PATH` (tasks do not use Zed's Node). +- `@reactivescript/language-server` installed in the project, so that + `node_modules/.bin/rx-tsc` exists at the worktree root. The extension's own + copy is not on the project's path. Yarn PnP, and a package that only lives + in a sub-package of a monorepo, are not covered. +- A `tsconfig.json` whose `include` names the `.rx` files. + +See +[Type-checking from the command line](../rx-language-server/README.md#type-checking-from-the-command-line). diff --git a/tooling/zed-rx/languages/reactivescript/tasks.json b/tooling/zed-rx/languages/reactivescript/tasks.json new file mode 100644 index 00000000..e70ee1f6 --- /dev/null +++ b/tooling/zed-rx/languages/reactivescript/tasks.json @@ -0,0 +1,15 @@ +[ + { + "label": "rx-tsc: type-check project", + "command": "npx", + "args": ["--no", "rx-tsc", "--noEmit"], + "cwd": "$ZED_WORKTREE_ROOT" + }, + { + "label": "rx-tsc: type-check project (watch)", + "command": "npx", + "args": ["--no", "rx-tsc", "--noEmit", "--watch"], + "cwd": "$ZED_WORKTREE_ROOT", + "use_new_terminal": true + } +]