Skip to content

Commit 82a3889

Browse files
committed
[docs][roadmap] Update with search and the end of disk-db-as-truth
1 parent 6d834da commit 82a3889

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

doc/docs/15-roadmap.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ The header-filtered sibling parsing optimization (see Optimization section) beco
7676
|**Disk snapshot strategy (operational)**
7777
|The `.cx` file functions as a startup snapshot. At startup, the server loads the snapshot into the file table and skips CUs whose disk mtime matches the stored mtime. On `-exit`, the server saves the current in-memory state back to disk. No prior `-create` needed — the first session builds references from scratch, subsequent sessions load the snapshot. See below for target semantics.
7878

79-
|**Search reads from in-memory table**
80-
|`OP_SEARCH` currently bypasses the in-memory `referenceableItemTable` entirely — `scanForSearch()` reads directly from disk `.cx` files. Once memory is truth, search should query the in-memory table with the same pattern matching (`shellMatch`, substring fitness). No new infrastructure needed — the data is already there after entry refresh. Depends on the references refresh module being in place so the in-memory table is reliably complete.
79+
|**Search reads from in-memory table (done)**
80+
|`OP_SEARCH` now queries the in-memory `referenceableItemTable` via `searchInMemoryTable()` in cxref.c, replacing the disk-based `scanForSearch()`. Same matching logic (`searchSymbolCheckReference`, `searchStringMatch`), same reference filtering (`UsageDefined`/`UsageDeclared`), same result printing. Skips `VisibilityLocal` (block-local) symbols, matching the snapshot's write filter. This was the last operation that read from disk `.cx` files as truth — **all operations now use the in-memory table**.
8181

8282
|**Snapshot write triggers (partially done)**
8383
|The `-exit` handler calls `markPreloadedFilesAsAncient()` + `saveReferences()`. The Emacs client sends `-exit` via `kill-emacs-hook` on quit, and `c-xref-kill-xref-process` sends `-exit` before killing (project change gets save for free). Two of three triggers are operational:
@@ -104,7 +104,7 @@ The path forward is:
104104
1. **Lightweight scanning replaces `-create`** (done) — discover CUs and include structure without full parsing. Populate the same `TypeCppInclude` references.
105105
2. **Snapshot save/load** (done) — `.cx` loaded at startup, saved on `-exit`. No manual `-create` needed after first session.
106106
3. **Refactoring moves into server (strangler fig)** (done) — all refactorings run as server operations via `OP_REFACTORY`. Legacy `-refactory` path remains for fallback; Emacs menu toggle enables battle-testing. Final cleanup: remove `RefactoryMode`, `callXref`, `parseBufferUsingServer` bridge.
107-
4. **`.cx` becomes startup snapshot only** — never consulted during operation. The in-memory table is authoritative. Search reads from memory. This is the current focus.
107+
4. **`.cx` becomes startup snapshot only** (done) — never consulted during operation. The in-memory table is authoritative. Search reads from memory. All operations now use the in-memory `referenceableItemTable`. The disk scan tables in `cxfile.c` (all except `snapshotLoadScanDispatchTable`) are candidates for removal.
108108

109109
==== .cx File: Startup Snapshot
110110

0 commit comments

Comments
 (0)