Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions WIP.IDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ children. Second person ("you") is allowed here, as in tutorials.
and the keyboard shortcuts, under `/tB/IDE/Reference/…`. Each entry gives the item, its
shortcut, one or two sentences, and a link to the chapter that explains it.

- The keymap is a table on its own page, `Reference/Keyboard-Shortcuts.md`, generated from
`main.js` by `ide_js.mjs keymap`: never edit its rows by hand.
- The keymap is a page of its own, `Reference/Keyboard-Shortcuts.md`, one table for each prefix
of a command's name, generated from `main.js` by `ide_js.mjs keymap`: never edit a section
before its See Also by hand, and put prose above the first `## `. A section's heading is the
prefix in code, with no title in words, because a heading such as `Call Stack` would be a title
match against the pages that explain the panel (WIP.Search.md).
- Webpage, the one pane that is not in a chapter, has a page of its own here.

**Moving pages.** When a page moves, its old permalink goes into `redirect_from:`, and every
Expand Down
2 changes: 1 addition & 1 deletion WIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ Why the report separates the wedged task from the merely blocked ones, and why
- `node scripts/vb6run.mjs <file | ->` and `node scripts/vb6run.mjs --docs [--only <regex>]` --- build and run VB6 code, so that what a sample prints in twinBASIC can be compared with VB6: a stand-alone file of statements or a `.bas` module, or `--docs`, which builds the documentation's `check_run` fences in VB6 and says for each whether it prints what its page says (`same`, `differs`, `not VB6`, `error`, `refused`; a `projname=` group is built as a project of its own, its `slot=file` fences translated into VB6 `.cls` and `.bas` components). It has no wrapper and is outside every gate and outside CI: it needs VB6 (`--vb6`, `VB6_EXE`, or the standard install folder). **Never start `VB6.EXE` from a shell**: in Git Bash `/make` is rewritten as a path and VB6 answers with a modal box on the desktop; the tool spawns it from Node with an argument array, and a sample that calls `MsgBox` or `InputBox` or contains `End` is refused. Its `Debug.Print` rewrite and its file translation have probes in `test/example-batches.test.mjs`, and its command-line cases are in `scripts/lib/cli-cases.mjs`; both need no VB6. What it relies on is in [WIP.ExamplesBuild.md](WIP.ExamplesBuild.md).
- `node scripts/errors.mjs run|generate|write` --- the run-time errors of the documented procedures, as data under `errors/` ([WIP.Errors.md](WIP.Errors.md), [Tools-Defects](docs/Documentation/Tools-Defects.md#errorsmjs)): `run` builds and runs a probe of the cases in twinBASIC 32-bit and 64-bit (`tbrun --exe`), VB6 and 64-bit VBA (in 64-bit Access, `scripts/lib/vba.mjs`) and compares each with the data, `write` writes each page's Errors section. Its gate is `check_errors.mjs`; `run` is by hand, never CI.
- `node scripts/recheck_callouts.mjs [--plan] [--kinds <list>] [--only <regex>] [--dry-run] [--report <f>] [--from <f>]` --- after a new BETA, checks again every callout labelled with an older one by running what its marker names (`ide_test`/`addin_test` once per suite, judging lane reproducers from the same report through `scripts/lib/lane-report.mjs`, `bug_repro verify` for the other reproducers, `check_examples --json` for samples, `errors.mjs run` for tb and win64, `test/llvm/run.mjs --only`, `test/static-linking/run.mjs --only`, `package_tests --json`), relabels what holds (a data file's `beta:` too, then `errors.mjs write`), and lists the rest. What it reads and decides is `scripts/lib/recheck.mjs`, probed by `check_callout_evidence.mjs`; every tool's output stays in `%TEMP%\recheck-callouts\<pid>\`. By hand, never CI.
- `node scripts/ide_js.mjs <command>` --- reads, names and patches the IDE's minified `ide/main.js` ([Tools-Defects](docs/Documentation/Tools-Defects.md#ide_jsmjs)): `survey`, `units`, `list`, `name`, `seal`, `check`, `view`, `patch`, `shape` and `keymap`, which writes the two tables of `docs/IDE/Reference/Keyboard-Shortcuts.md` from the build, each command's description coming from `scripts/ide-js/command-text.json` (`--check` fails for a command with no entry there). It reads files and starts nothing; the rules for it are under [Driving the twinBASIC compiler](#driving-the-twinbasic-compiler) (*Fixing the IDE itself*). It has no wrapper and is outside every gate and CI, since it needs an install; its tests are `test/ide-js.test.mjs`, in `test.bat`, and its command-line cases are in `scripts/lib/cli-cases.mjs`. **After a new BETA, run `check` on it**, and `seal` the map once each `review` and `lost` name has been looked at, **and `keymap --check`**, then `keymap --update` if the group changed.
- `node scripts/ide_js.mjs <command>` --- reads, names and patches the IDE's minified `ide/main.js` ([Tools-Defects](docs/Documentation/Tools-Defects.md#ide_jsmjs)): `survey`, `units`, `list`, `name`, `seal`, `check`, `view`, `patch`, `shape` and `keymap`, which writes the sections of `docs/IDE/Reference/Keyboard-Shortcuts.md` from the build, a table for each prefix of a command's name, each command's description coming from `scripts/ide-js/command-text.json` (`--check` fails for a command with no entry there). It reads files and starts nothing; the rules for it are under [Driving the twinBASIC compiler](#driving-the-twinbasic-compiler) (*Fixing the IDE itself*). It has no wrapper and is outside every gate and CI, since it needs an install; its tests are `test/ide-js.test.mjs`, in `test.bat`, and its command-line cases are in `scripts/lib/cli-cases.mjs`. **After a new BETA, run `check` on it**, and `seal` the map once each `review` and `lost` name has been looked at, **and `keymap --check`**, then `keymap --update` if the group changed.

Three generators sit outside that loop and produce committed artifacts rather than build output — none runs during a build, and none is needed for one. `python scripts/build_fonts.py` rebuilds the subset webfaces under `docs/assets/fonts/` and needs a network connection; `node scripts/build_dot_metrics.mjs` regenerates `builder/inter-metrics.json` from those webfaces and needs only a browser. See [Typography](#typography). `node indexer/twin-index.mjs derive` regenerates `builder/package-api.json`, the packages' declared API that the build's symbol index (`tB/symbols.json`, for the IDE help add-in) is annotated from; it needs a twinBASIC install (or `--release`), so **run it when the reference is re-indexed against a newer build** and commit it with the pages and the snapshots. See [WIP.HelpAddin.md, Stage 3](WIP.HelpAddin.md#stage-3-the-symbol-index-generated-by-the-docs-build).

Expand Down
2 changes: 1 addition & 1 deletion docs/Documentation/Tools-Defects.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ Reads, names and patches the twinBASIC IDE's own JavaScript, `ide/main.js` in th
| `view <unit>...` | The readable view: each unit with the map's names put in (only the `exact` and `carried` ones), pretty-printed by prettier, under a comment that names the build, where the unit is in `main.js`, its shape, the names applied and any not applied. `--all --out <file>` writes the whole file so, about 50,000 lines. |
| `patch <fix.js>` | Splices a fix into `main.js`. `<fix.js>` holds whole units in the map's names, as the view prints them: top-level functions, and a class holding each method that is fixed. For each unit, the map's names are turned back into the build's minified names, the unit's tokens are compared with the fix's (a string by its value, so the view's quotes are no difference), and each run of tokens that differs becomes one edit of the minified text. The patched file is parsed again, and each patched unit must have the fix's shape, so the patched `main.js` runs the code the fix shows. Each edit is printed before and after, in the minified text. Every difference becomes an edit, so a fix patched into a later build whose unit changed takes that change back out: run `shape` on that build first. |
| `shape <fix.js>` | The fix shape, as markdown for the defect's entry: for each unit of the fix, which names are the map's and what the build calls them, and a diff of the unit as the build has it against the fix, both in the map's names and printed alike. |
| `keymap` | Prints the build's commands as the two tables of [`IDE/Reference/Keyboard-Shortcuts.md`](../../tB/IDE/Reference/Keyboard-Shortcuts): the commands with a default key, with their keys, and the commands with none, each with one row by name and a line on what it does. The lines are written by hand in `scripts/ide-js/command-text.json`, which maps each command's id to its description; an id with an empty description gets an empty cell. `--check` compares the page's tables with the build, prints what differs and exits 1 if anything does, and exits 1 too, naming the ids, when a command of the build has no entry in the data file or the file has an entry for a command the build lacks; `--update` writes the tables into the page, leaves the rest of it alone, and prints the same ids without failing. Run `--check` after a new BETA, and write the descriptions it asks for. |
| `keymap` | Prints the build's commands as the sections of [`IDE/Reference/Keyboard-Shortcuts.md`](../../tB/IDE/Reference/Keyboard-Shortcuts): a heading and a table for each prefix of a command's name, and a last section for the names with no prefix, with one row for each command by name, its keys, and a line on what it does. A table with no default key in it has no **Keys** column. A row's name keeps its prefix in a `.command-prefix` span, which the site's stylesheets give no size, so the find on the page and the site's search still take the whole name. The lines are written by hand in `scripts/ide-js/command-text.json`, which maps each command's id to its description; an id with an empty description gets an empty cell. `--check` compares the page's sections with the build, prints what differs and exits 1 if anything does, and exits 1 too, naming the ids, when a command of the build has no entry in the data file or the file has an entry for a command the build lacks; `--update` writes the sections into the page, replacing everything from its first `## ` heading to its `## See Also`, leaves the rest of it alone, and prints the same ids without failing. Run `--check` after a new BETA, and write the descriptions it asks for. |

**Only a copy of an install is ever patched.** `patch --copy-to <dir>` copies the install into a folder of its own under `<dir>`, which must be under the system temp folder, without its `projects\` and `addins\` folders, writes the patched `main.js` into the copy and prints the copy's `twinBASIC.exe`. Give that to the IDE tests, `ide-test.bat --ide <copy>\twinBASIC.exe --only <lane>`, to see the defect's test report that it no longer reproduces while the controls pass; delete the folder afterwards. `patch --out <file>` writes the patched `main.js` alone, and refuses a file inside the repository or inside an install that is not under the temp folder. `view --out` refuses the repository too: no copy of `main.js`, whole or viewed, belongs in it. A fix is kept as `bugs/<slug>/fix.js` beside the defect's reproducer.

Expand Down
4 changes: 2 additions & 2 deletions docs/IDE/Customising/Keyboard-Shortcuts.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Text that is not valid JSON turns red. The IDE ignores a group whose text is not

## The text of a group

A group is a JSON object. Each key names a command, and each value is a list of key strings. Any command of the IDE can be named, whether or not the default group gives it a key. The [reference](../Reference/Keyboard-Shortcuts) lists every command with a line on what it does: the commands that have a default key in one table, and [those that have none](../Reference/Keyboard-Shortcuts#commands-with-no-default-key) in another. It is the place to look up the name of a command.
A group is a JSON object. Each key names a command, and each value is a list of key strings. Any command of the IDE can be named, whether or not the default group gives it a key. The [reference](../Reference/Keyboard-Shortcuts) lists every command with its default keys and a line on what it does, in one table for each prefix of a command's name. It is the place to look up the name of a command.

| Entry | Meaning |
|---|---|
Expand Down Expand Up @@ -126,7 +126,7 @@ When a command fails, the Debug Console prints `command failed:` and the command

## See Also

- [Keyboard shortcuts reference](../Reference/Keyboard-Shortcuts) -- every command the default group binds, with its keys
- [Keyboard shortcuts reference](../Reference/Keyboard-Shortcuts) -- every command of the IDE, with its default keys
- [Window menu](../Reference/Menu/Window#keyboard-shortcuts) -- the **Keyboard Shortcuts** entry
- [Panel layouts](Panel-Layouts) -- the commands that switch layouts
- [Themes](Themes) -- the commands that switch themes
Expand Down
2 changes: 1 addition & 1 deletion docs/IDE/Menu/Window.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Switches groups of keyboard shortcuts on and off. See [Keyboard shortcuts](../..

Opens a dialog that lists the built-in group, which is read-only, and the groups that have been created, and shows each as JSON text. See [Manage keyboard shortcuts](../../Customising/Keyboard-Shortcuts#manage-keyboard-shortcuts) and [The text of a group](../../Customising/Keyboard-Shortcuts#the-text-of-a-group).

[Keyboard shortcuts](../Keyboard-Shortcuts) lists the built-in group as a table.
[Keyboard shortcuts](../Keyboard-Shortcuts) lists the built-in group in tables.

## Theme
{: index_also="dark mode" }
Expand Down
Loading
Loading