pmacs/tests
Levi Neuwirth 558d00020f fix(highlight): PR #116 round 2 — pin grammar across switch, attached env -S
Two follow-ups from review, both in builtin/runtime/syntax.lua.

1. [P2] Buffer switching bypassed the pinned grammar. after-edit already
   reparsed the pinned language, but the after-switch reattach path
   (attach_for_active_buffer) re-resolved from scratch — so open an
   extensionless `#!/bin/sh` (bash), edit its shebang to lua, switch away
   and back, and the grammar flipped to lua while the LSP side kept its
   bash attachment (lsp.lua's after-switch reuses the existing record).
   attach_for_active_buffer now reuses the language pinned at first attach
   whenever a parse view already exists; only a first-seen buffer
   resolves. A language change still needs a close/reopen, matching both
   the after-edit behavior and how extensions work.

2. [P2] Attached `env -S`/`--split-string` forms failed. The walk skipped
   the whole option token, but for split-string the interpreter rides
   inside it: `-Spython3`, `-vSpython3` (after no-operand short flags
   i/v/0), and `--split-string=python3` all resolved to nil (the last was
   also eaten by the earlier `=` branch). The env walk now extracts the
   interpreter from the attached value (`^-[iv0]*S(.+)$` /
   `^--split-string=(.+)$`); the separated forms (`-S python3`) still work
   by walking on to the next token.

Tests (bite-verified against the round-1 syntax.lua — both fail there;
scripts/bite HEAD builtin/runtime/syntax.lua):
- m4_shebang_edit_keeps_pinned_grammar now adds a switch-away/back cycle
  (via pmacs.window.switch_buffer, which fires after-switch
  synchronously) and asserts the tree stays bash.
- m4_shebang_resolver_maps_interpreters adds the attached split-string
  cases (`-Spython3`, `--split-string=python3`, `-vSpython3`).

Gates: fmt; clippy -D warnings; m4_acceptance --skip basedpyright; GPU;
git diff --check green. Only-known-flake caveat as round 1
(editor::composition_overhead_under_ten_percent perf microbenchmark,
unrelated to this Lua change). Change is Lua-only plus the acceptance
tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YJ9FQ832QwftJXCD9LeFan
2026-07-14 15:20:22 +01:00
..
common feat(edit): auto-pairing (Arc 2) 2026-07-11 17:11:56 +01:00
fixtures V0.2-prerequisite pull-forward + M10.11 clean audit round 2026-05-18 10:31:31 -04:00
acceptance.rs Collapse if-let nests into let-chains (MSRV-1.95 collapsible_if sweep) 2026-05-18 14:29:36 -04:00
auto_indent_acceptance.rs fix(edit): PR #109 round 1 — shared search invalidation, daemon anchor clear, bounded indent scan 2026-07-10 15:46:36 -04:00
auto_indent_crdt_acceptance.rs feat(edit): auto-indent on newline (Arc 2) 2026-07-10 12:11:05 -04:00
auto_pair_acceptance.rs test(edit): PR #110 round 3 — pin raw-byte predicate posture and top-level sets guard 2026-07-12 16:20:01 +01:00
auto_pair_crdt_acceptance.rs feat(edit): auto-pairing (Arc 2) 2026-07-11 17:11:56 +01:00
autosave_acceptance.rs fix(persistence): adopt clears the old owner's skip cache; failing sweeps are loud 2026-07-09 12:06:49 -04:00
comment_toggle_acceptance.rs feat(edit): comment/uncomment toggle on M-; (Arc 2) 2026-07-09 22:56:44 -04:00
compile_mode_acceptance.rs fix(compile): make overlay teardown atomic 2026-07-14 10:57:14 +01:00
compile_mode_crdt_acceptance.rs fix(compile): PR #113 round 4 — column-counted CR rewrites, alt-screen style resync 2026-07-13 17:55:08 +01:00
completion_popup_acceptance.rs fix(lsp): range-only providers, completion-accept boundary, exact codepoint classify 2026-07-09 20:48:08 -04:00
cua_region_acceptance.rs CUA type-over is a single undo step (Q#U1) 2026-06-15 20:00:53 -04:00
desktop_acceptance.rs fix(persistence): reliable daemon gate, unarm, per-pane after-load 2026-07-08 22:27:24 -04:00
editops_acceptance.rs fix(edit): PR #111 round 1 — scalar-valid UTF-8, per-word capitalize, trim error reporting 2026-07-12 16:34:18 +01:00
kill_ring_acceptance.rs fix(edit): exact effective-edit verification for kill/yank-pop 2026-07-09 20:40:48 -04:00
listview_acceptance.rs feat(panels): listview module, Q#P6 round-trip seam, references panel 2026-07-07 20:15:46 -04:00
m3_acceptance.rs Initial commit: v0.1.0 2026-05-03 19:51:06 -04:00
m4_acceptance.rs fix(highlight): PR #116 round 2 — pin grammar across switch, attached env -S 2026-07-14 15:20:22 +01:00
m5_5_acceptance.rs Collapse if-let nests into let-chains (MSRV-1.95 collapsible_if sweep) 2026-05-18 14:29:36 -04:00
m5_6_acceptance.rs Initial commit: v0.1.0 2026-05-03 19:51:06 -04:00
m5_7_acceptance.rs CI fixes 2026-05-18 12:24:35 -04:00
m5_8_acceptance.rs tests: widen backoff timing signal 2026-05-25 13:32:54 -04:00
m5_perf_acceptance.rs M11.1: semantic-frontend protocol scaffolding (wire + capability) 2026-05-18 19:39:07 -04:00
m6_4_repl_acceptance.rs Fix PTY final-output drain race 2026-05-04 09:44:30 -04:00
m6_5_repl_acceptance.rs tests: quarantine macOS PTY marker cases 2026-05-25 13:02:46 -04:00
m6_7_scrollback_acceptance.rs Initial commit: v0.1.0 2026-05-03 19:51:06 -04:00
m6_8_multi_repl_acceptance.rs Collapse if-let nests into let-chains (MSRV-1.95 collapsible_if sweep) 2026-05-18 14:29:36 -04:00
m6_perf_acceptance.rs tests: tune M6 hosted perf profile 2026-05-25 13:43:28 -04:00
m7_3_acceptance.rs Fix CI and Documentation issues 2026-05-04 10:19:19 -04:00
m7_5_acceptance.rs fix(packages): basename-collision reject, SHA-256 cache key, timeout thread join, commit→revision, dead-code (F-005/F-009–F-012) 2026-07-03 18:47:23 -04:00
m7_6_acceptance.rs fix(packages): basename-collision reject, SHA-256 cache key, timeout thread join, commit→revision, dead-code (F-005/F-009–F-012) 2026-07-03 18:47:23 -04:00
m7_7_acceptance.rs M7 tail: package system, audit lint, lockfile, resolver 2026-05-07 16:50:37 -04:00
m7_8_acceptance.rs M7 tail: package system, audit lint, lockfile, resolver 2026-05-07 16:50:37 -04:00
m7_9_acceptance.rs M7 tail: package system, audit lint, lockfile, resolver 2026-05-07 16:50:37 -04:00
m7_10_acceptance.rs fix(packages): basename-collision reject, SHA-256 cache key, timeout thread join, commit→revision, dead-code (F-005/F-009–F-012) 2026-07-03 18:47:23 -04:00
m7_11_acceptance.rs M7 tail: package system, audit lint, lockfile, resolver 2026-05-07 16:50:37 -04:00
m7_review_acceptance.rs M7 tail: package system, audit lint, lockfile, resolver 2026-05-07 16:50:37 -04:00
m8_1_acceptance.rs Pin toolchain to 1.95.0 + mechanical clippy/rustc fixes 2026-05-18 11:38:57 -04:00
m8_1c_acceptance.rs M7 tail: package system, audit lint, lockfile, resolver 2026-05-07 16:50:37 -04:00
m8_1d_acceptance.rs M7 tail: package system, audit lint, lockfile, resolver 2026-05-07 16:50:37 -04:00
m8_2_acceptance.rs tests: stabilize hosted perf gates 2026-05-25 13:20:18 -04:00
m8_3_acceptance.rs M7 tail: package system, audit lint, lockfile, resolver 2026-05-07 16:50:37 -04:00
m8_5_acceptance.rs M7 tail: package system, audit lint, lockfile, resolver 2026-05-07 16:50:37 -04:00
m8_6_acceptance.rs M7 tail: package system, audit lint, lockfile, resolver 2026-05-07 16:50:37 -04:00
m8_7_acceptance.rs M7 tail: package system, audit lint, lockfile, resolver 2026-05-07 16:50:37 -04:00
m8_9_acceptance.rs V0.2-prerequisite pull-forward + M10.11 clean audit round 2026-05-18 10:31:31 -04:00
m8_10_acceptance.rs V0.2-prerequisite pull-forward + M10.11 clean audit round 2026-05-18 10:31:31 -04:00
m9_1_acceptance.rs T M4.5 async bridge: LSP requests settle async-runtime jobs 2026-05-18 19:36:17 -04:00
m9_2_acceptance.rs style: from_secs(1) for the m9_2 harvest wait (clippy duration units) 2026-06-10 12:07:08 -04:00
m9_3_acceptance.rs Collapse if-let nests into let-chains (MSRV-1.95 collapsible_if sweep) 2026-05-18 14:29:36 -04:00
m9_4_acceptance.rs M9 ship gate 2026-05-09 15:04:23 -04:00
m9_5_acceptance.rs M9 ship gate 2026-05-09 15:04:23 -04:00
m9_6_acceptance.rs M9 ship gate 2026-05-09 15:04:23 -04:00
m9_7_acceptance.rs M9 ship gate 2026-05-09 15:04:23 -04:00
m9_8_acceptance.rs M9 ship gate 2026-05-09 15:04:23 -04:00
m10_2_perf.rs M10.10 ship gate 2026-05-13 16:28:46 -04:00
m10_10_perf.rs M10.10 ship gate 2026-05-13 16:28:46 -04:00
m10_10_postcard_unknown_variant.rs M10.10 ship gate 2026-05-13 16:28:46 -04:00
m10_11_acceptance.rs M11.1: semantic-frontend protocol scaffolding (wire + capability) 2026-05-18 19:39:07 -04:00
m10_11_perf.rs M10.11: adversarial two-laptop acceptance + jitter; the M10 arc verified 2026-05-15 20:51:00 -04:00
m11_5_semantic_acceptance.rs M11.5: semantic frontend<->instance glue (SemanticClient + e2e) 2026-05-18 21:24:36 -04:00
overlay_reattach_acceptance.rs fix(panels): follow active buffer on semantic frontends; re-attach overlays on switch 2026-07-07 20:46:50 -04:00
persistence_acceptance.rs fix(persistence): symlink confinement, real test-inertness, view_top restore 2026-07-08 18:21:46 -04:00
query_replace_acceptance.rs fix(query-replace): pin the session to its origin buffer (wrong-buffer guard) 2026-07-08 17:07:08 -04:00
save_clobber_guard_acceptance.rs fix(save): refuse to silently clobber a file changed on disk 2026-07-09 14:12:45 -04:00
worker_shutdown_acceptance.rs fix(completion): address TUI-validation findings (LSP query gaps, scoping, prefix keys, window scope) 2026-07-07 16:54:14 -04:00