M1.13: watch open buffers' folders, bufferFocused, truncated tree row

- The parent directory of every open buffer is pinned in the project
  watcher (workspace::sync_buffer_dirs after every command): it counts
  against the cap but is never evicted while a buffer in it is open, so
  reloads and fileChangedOnDisk arrive for never-expanded folders.
- file.open on an already-open buffer emits the new bufferFocused {id};
  the editor activates that tab and it outranks pending adoptions.
- The project tree shows a "Listing truncated" note row
  (project.tree.truncated) after a partly listed directory.
- Tests: engine (pinning, eviction, focus), control channel
  (bufferFocused), Vitest (tab switch, race, truncated row).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-10-16 16:20:11 +02:00
parent 7b7273a947
commit 8a71f7bd08
19 changed files with 312 additions and 30 deletions

View file

@ -107,6 +107,9 @@ fn streams_command_and_disk_events() {
let r = client.call(execute("file.open", json!({"path": "a.php"})));
let id = r["result"]["id"].as_u64().unwrap();
assert_eq!(client.event("bufferOpened")["id"], id);
let r = client.call(execute("file.open", json!({"path": "a.php"})));
assert_eq!(r["result"]["id"], id);
assert_eq!(client.event("bufferFocused")["id"], id);
let r = client.call(execute(
"buffer.edit",