From 56f17f199ee2bc0a77e090c43dd367f43c909f2c Mon Sep 17 00:00:00 2001 From: _ov4 Date: Tue, 13 Oct 2026 08:28:04 +0000 Subject: docs(plugin): explain terminal execution and verification Co-Authored-By: Claude Fable 5.1 --- plugin/AGENTS/ARCH.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'plugin/AGENTS/ARCH.md') diff --git a/plugin/AGENTS/ARCH.md b/plugin/AGENTS/ARCH.md index 3199457..1a1c076 100644 --- a/plugin/AGENTS/ARCH.md +++ b/plugin/AGENTS/ARCH.md @@ -2,7 +2,8 @@ The extension registers `cie-pseudocode` for `.cps` files. It targets VS Code 1.85+ and dark themes. Runtime code uses CommonJS JavaScript and the VS Code API, with -no npm runtime dependencies or connection to the compiler or cpptools. +no npm runtime dependencies. Running files invokes the installed `cpsc` executable; +there is no compiler library or cpptools integration. ## Native editor capabilities and upstream references @@ -17,6 +18,9 @@ no npm runtime dependencies or connection to the compiler or cpptools. server are not called, imported or bundled. This extension is not a cpptools fork. The formatting API accepts locally computed edits; it does not implement CIE indentation itself. +- `src/runner.js` adapts Code Runner's terminal creation, display, reuse, close + handling and Windows shell detection. The editor title button uses the same + native `$(play)` icon. Upstream revision and notice are in `ThirdPartyNotices.md`. Native `indentationRules` and `onEnterRules` are not currently configured. The on-type provider uses the same custom block-depth engine as selection formatting. @@ -42,6 +46,29 @@ Source attribution is retained in `ThirdPartyNotices.md`. - `src/brackets.js` uses a stack to report unmatched opening and closing brackets and crossed types. Only invalid brackets receive the red decoration; native bracket coloring handles valid pairs. +- `src/runner.js` registers `cie-pseudocode.runFile`. It saves the target document, + uses the new file URI after an untitled save, ignores selections and runs + `cpsc file -r` in a focused, reusable terminal. Only that terminal's close event + clears the cached terminal; extension disposal closes it. + +## Terminal execution + +`cie-pseudocode.compilerPath` is a resource-scoped executable name or full path, +defaulting to `cpsc`. Read it for the saved file. The working directory is that +file's workspace folder, falling back to its containing directory. + +Unix commands use POSIX single-quote escaping and `cd ... && ...`. Windows +PowerShell uses literal paths, doubled single quotes, `if ($?)` and the `&` call +operator. Command Prompt uses quoted paths, `cd /d` and `&&`. Windows detection +adapts Code Runner's default-profile logic and also recognizes `pwsh` and custom +profile paths. Cache the shell kind with the terminal, since changing the default +profile does not change an existing terminal. Windows bash profiles and non-POSIX +Unix shells are outside the supported terminal set. + +Save cancellation starts nothing. Save or terminal setup failures show an English +error message; compiler and program diagnostics go directly to the terminal. +Terminal execution follows Code Runner's reuse behavior: users must finish or +interrupt an interactive program with Ctrl+C before running another file. ## Language rules and defaults -- cgit v1.3.1-4-g156e