Lutra/ui/tests
danny 578160a2ba M3.5: go to definition, find references and rename through Phpactor
Engine (`cmd/lsp_nav.rs`, on the pending outcomes of 20d1d28):
- `lsp.definition` (F12) and `lsp.references` (Shift+F12, sorted, with
  line previews) return project-relative locations; locations outside
  the project, such as PHAR stubs and symlink escapes, are dropped.
- `lsp.prepareRename` uses the word at the cursor when the server has
  no prepareProvider.
- `lsp.rename` (F2) applies the workspace edit (`lsp_nav/edit.rs`):
  1. Check everything first: inside the project, ranges fit (UTF-16,
     CRLF), open buffers unchanged since the request, no file
     operations, no incomplete edit.
  2. Write closed files atomically through the VFS, restoring earlier
     writes when a later one fails.
  3. Change open buffers through `buffer.edit` (dirty, undoable).
  4. Send each written file to Phpactor as didOpen/didSave/didClose
     plus didChangeWatchedFiles; without this its index kept the old
     names. Then the summary notification `notification.lsp.renamed`.

UI (`components/editor/nav/`):
- Mod+click goes to the definition, with a pointer cursor while Mod is
  held.
- A location picker for several definitions (exclusive modal).
- A References tab in the bottom panel, grouped by file.
- An inline rename field with a use/file count (exclusive modal).
- `BufferSync.beginUndoableRemote` puts the engine's rename edit into
  the editor history as one undo step per buffer.
- Catalog strings and tokens only.

Fake LSP server: `--script FILE` with scripted capabilities and
answers (additive next to M3.4's arms).

Tests:
- `crates/engine/tests/lsp_nav.rs` (fake): definition; bad positions;
  references; prepareRename; a multi-file rename incl. a closed CRLF
  file; refusals for outside the project, a bad range, a stale buffer,
  bad names and no server.
- The ignored real-Phpactor test covers definition, references and a
  rename and back across 3 files.
- Vitest `ui/tests/nav/`.

Live (Phpactor 2026.06.25.0, Windows, port 7935, tick on):
- definition 93 ms cold / 7-18 ms warm
- references ~140 ms
- prepareRename ~11 ms
- rename 28-59 ms
- index follows written files in 140 ms
- Phpactor 57 MB working set, ~1.6% of a core while ticking idle

Gate: 13 steps, 197 s, Vitest 484 + 1 skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:50:15 +02:00
..
commands M1.15: one modal at a time, restore dialog follows outside restores 2026-10-16 21:49:38 +02:00
editor M3.4: completion, hover and signature help from Phpactor 2026-10-22 18:38:07 +02:00
find M2.4: Find tool window in a new bottom panel 2026-10-17 12:42:53 +02:00
goto M2.6: go-to popup for files, classes and symbols 2026-10-17 17:35:50 +02:00
i18n M3.5: go to definition, find references and rename through Phpactor 2026-10-22 18:50:15 +02:00
layout M1.5: main window layout and project tree against mocked engine events 2026-10-14 19:24:23 +02:00
menu M3.4: completion, hover and signature help from Phpactor 2026-10-22 18:38:07 +02:00
nav M3.5: go to definition, find references and rename through Phpactor 2026-10-22 18:50:15 +02:00
notifications M1.12: notifications as toasts 2026-10-16 16:20:45 +02:00
palette M3.4: completion, hover and signature help from Phpactor 2026-10-22 18:38:07 +02:00
problems M3.3: engine wiring for Phpactor and diagnostics 2026-10-21 18:58:32 +02:00
project M1.13: watch open buffers' folders, bufferFocused, truncated tree row 2026-10-16 16:20:11 +02:00
recovery M1.15: one modal at a time, restore dialog follows outside restores 2026-10-16 21:49:38 +02:00
settings M1.9b: settings dialog with search 2026-10-16 21:13:04 +02:00
structure M2.7: Structure tool window and syntax.outline 2026-10-17 17:04:12 +02:00
terminal M3.6: integrated terminal with PTY sessions and xterm.js sub-tabs 2026-10-20 21:10:37 +02:00
theme M3.6: integrated terminal with PTY sessions and xterm.js sub-tabs 2026-10-20 21:10:37 +02:00
App.test.ts M2.7: Structure tool window and syntax.outline 2026-10-17 17:04:12 +02:00
ipc.test.ts M3.5: pending outcomes for commands that wait for the language server 2026-10-22 06:36:20 +02:00
ipcEvents.test.ts M1.12: notifications as toasts 2026-10-16 16:20:45 +02:00