Code reference detail
startup-gate.ts
packages/extension/src/extension/startup-gate.ts
| Idea | Status | Tags | Summary | Katz |
|---|---|---|---|---|
| activation | VS Code loads the extension host entry at ["../../../packages/extension/src/extension/main.ts"] when an activation event in ["../../../packages/extension/package.json"] matches. The exported `activate(context)` function is the single activation entry point for [scope.vscode_extension]. Install-time and first-run sequencing across extension vs base layers: ["./installation.rq".installation_sequencing]. Startup failure diagnosis, first-paint sequencing, bundle splitting, and development-host lessons: ["./startup-performance.rq"]. | 0.064 | ||
| first_paint_startup | done | The activity-bar HTML shell is assigned by ["../../../packages/extension/src/activity_bar_module/activity-bar-webview-provider.ts"] after one event-loop turn ( retry once on invalid-state ). Host `postMessage` starts only after the webview `ready` handshake; disposed / invalid-state errors are swallowed by ["../../../packages/extension/src/shared/safe-webview-post.ts"]. Its Svelte app installs the host message listener before mount, then sends the one-shot `ready` handshake from a task queued after its first animation frame. ["../../../packages/extension/src/extension/startup-gate.ts"] resolves that handshake once; `IndexService.activate` then discovers bases and syncs. If no view opens, a bounded three-second fallback starts the index without any visible first paint to contend with. Index open / sync requires the host-matching core engine ( rusqlite ); missing `.node` fails activate. Windows claim / dispose races: ["./startup-performance.rq".webview_claim_race]. | 0.148 | |
| extension_startup_reliability | done | Reqlan startup must make the activity-bar shell and contributed commands available before optional indexing, parser construction, database initialization, or language-client startup can monopolize the extension host. The implementation contract is [first_paint_contract], [webview_claim_race], [deferred_startup_sequence], [lazy_runtime_dependencies], and [development_bundle_freshness]. Operational diagnosis follows [startup_diagnostics]. [activation.activation_sequence] [activitybar.loading_state] [indexer.nonblocking_index] [build.extension_bundle] | 0.046 | |
| first_paint_contract | done | The platform spinner ends only after VS Code loads the host module, calls `activate`, the provider registers, and `resolveWebviewView` assigns HTML. `resolveWebviewView` is async: it binds the view, yields one turn so the overlay can be claimed, then assigns the lightweight HTML / Svelte shell ( retry once on invalid-state ). It does **not** `postMessage` in that method. The webview installs its host message listener, mounts, waits for its first animation frame, then posts the one-shot `ready` signal from a queued task. Host messages start only after that handshake. Index discovery / sync waits for the same signal so synchronous parser or database setup cannot race the first visible frame. Windows overlay restore can dispose and re-resolve the sidebar; the provider rebinds and waits for a new `ready`. [activation.first_paint_startup] [webview_claim_race] ["../../../packages/extension/webviews/activity-bar/App.svelte"] ["../../../packages/extension/webviews/activity-bar/state/app.svelte.ts"] ["../../../packages/extension/src/extension/startup-gate.ts"] ["../../../packages/extension/src/shared/safe-webview-post.ts"] | 0.058 |
Reference labels
"../../../packages/extension/src/extension/startup-gate.ts", ../../../packages/extension/src/extension/startup-gate.ts