Code reference detail
workspace-index.ts
reqlan rq/indexer/packages/analytical/src/index-store/workspace-index.ts
| Idea | Status | Tags | Summary | Katz |
|---|---|---|---|---|
| inbound_snapshot_events | done | Host → LSP inbound snapshots are event-driven and incremental. Push only when the ideas index is ready ( catalog update, ready-edge, visible-editor change, or window focus ). While Syncing or not ready, do not push an empty batch that clears the language-server last-good map; set a deferred flag and flush on the next ready event. The language client often starts before the index — registration must ensure-open / defer, not skip forever. Each notification is a per-document merge for visible editors; URIs not in the batch stay as last-good until replaced or the document closes. After a single-file enqueue reaches ready, notify catalog so consumers get a ready-state event ( mid-sync catalog notifies alone are not enough ). Coalesce concurrent push work so catalog spam drains to one ready pass. Related: [unify_inbound_indexes], ["../extension/language/support/open-file-sequencing.rq".lazy_features_after_outbound], ["../extension/language/syntax/features-syntax-highlighting.rq".inbound_inlay_index_performance]. | 0.133 | |
| single_sync_walk | done | One native directory walk records base roots, `.rq` paths, and allowlisted code paths. The walk does not read file bodies. Startup, Refresh, and create-base each run that walk once. They do not call `findFiles` and they do not run a second native `syncWorkspace` walk. Soft sync indexes the path list and skips unchanged mtimes. Idle stale check stats paths already stored in SQLite. New files arrive from the file watcher. The language server does not walk. The extension sends the base roots after the scan. Overlapping callers share one in-flight scan. CLI and MCP `sync_workspace` uses the same walk ( one pass, stop at nested bases ). [index_cache_reuse] [sequencing.soft_sync] [sequencing.scan_limits] | 0.080 | |
| git_dates | done | Creation and last-modified dates, and change count, for ideas via git history where available. Values are written into the ideas index by the `git_dates` analyser as a silent background job after soft-sync / catalog updates ( batched, yielded ) — not triggered by Activity Bar focus, opening Timeline, or Ideas table load. Host queue and rate caps: ["../extension/index-host/git-codelens.rq".git_dates_background_indexing]. | 0.143 | |
| index | The ideas graph indexer: parse `.rq` with the native engine, extract ideas / edges, persist to rusqlite SQLite. Same-file `[ideaset.member]` edges target the member leaf ( ["../language/syntax.rq".references_to_subidea] ). Wildcard path + idea fan-out: [wildcard_reference_edges] ( ["../language/imports.rq".wildcard_references] ). Ideas Summary graph can hide those edges via [ideas_summary_doc] / ["../extension/workspace-summary/ideas_summary/graphical_graph.rq".wildcard_refs_toggle]. Soft mtime sync skips unchanged files. `extract_version` in the ideas index meta is the extract-rule generation. When that number does not match the engine, sync rebuilds so stale edges do not remain ( ["../language/syntax.rq".inline_code] ). Owned by [ownership]; consumed per [consumption]. | 0.587 | ||
| index_diagnostics_timing | Soft sync and per-file index paths record durations into the diagnostic index under [app_memory_doc.index_diagnostics_store]. See ["../extension/index-host/index-diagnostics.rq".index_diagnostics_metrics]. Must not block [nonblocking_index]; recording failures are swallowed / logged by the store and must not fail the sync. | 0.096 | ||
| index_ideas | Each ["../bases/base.rq".base] maintains an index of its ideas for fast lookup and navigation ( [index] ). The index should update incrementally as. rq files change within that base ( nested child bases excluded ). Persistence lives in [app_memory_doc.application_memory] per base, shared with CLI and MCP — not VS Code extension storage. Engine ownership: [workspace_index] in `@reqlan/analytical`; multi-base via BaseRegistry; editor watches via [editor_index_adapter]. | 0.173 | ||
| indexing_incrementality | Indexing should be incremental: watcher-driven single-file updates, and soft full syncs that skip unchanged files by stored mtime. Hard rebuilds reparse everything. Detail and UX ( progress, cancel, non-blocking UI ): [nonblocking_index]. | 0.161 | ||
| nonblocking_index | done | Index sync must stay non-blocking for the host UI ( notably [activity_bar_doc.activity_bar] and [workspace_pane_doc.workspace_loading] ). Editor startup is gated by ["../extension/host/activation.rq".first_paint_startup]; discovering a base must not construct Langium services, which are initialized lazily on the first parse. While syncing, surface progress — state, processed / total, and the current file — in [workspace_pane_doc.workspace_pane] and [ideas_summary_doc.index_panel]. In-flight sync must be cancellable from those surfaces; cancel keeps already-indexed rows and returns the index to ready. Incremental behaviour ( see also [indexing_incrementality] ): - Single-file create / change / delete via watchers indexes only that file — never a full base walk. - Soft full sync ( `syncWorkspace` / Refresh ) skips parse + persist when the file's mtime matches the value stored on the documents row. - Hard refresh ( `clearAndRebuildIndex` / Clear & rebuild ) wipes the store and reindexes every file. - Every sync and stale check applies `.rqignore` to the paths it receives, the same as the base walk; the native single-file index also drops an ignored path. Thus base discovery cannot make the first sync index ignored files. Implemented by [workspace_index]; editor adapter [editor_index_adapter]. | 0.372 | |
| ownership | The [index] / indexer lives in `packages/analytical` ( `@reqlan/analytical` ). Canonical single-base engine: [workspace_index] ( `WorkspaceIndex` facade ). Sync / idle impl: [workspace_index_sync]; one-file parse + persist: [workspace_index_file]; mtime stale diff: [workspace_mtime]. Multi-base registry: one `WorkspaceIndex` per discovered ["../bases/base.rq".base] under [app_memory_doc.application_memory] ( `<base>/.reqlan/` ). Headless entry: [analysis_runtime] via native-only `openAnalysisApi` ( CLI / MCP ). On-disk store path: [application_memory_impl] under `<base>/.reqlan/` — see [app_memory_doc.application_memory]. | 0.237 |
Reference labels
git_dates, inbound_snapshot_events, index, index_diagnostics_timing, index_ideas, indexing_incrementality, nonblocking_index, ownership, single_sync_walk