Expand description
§Persistent Storage handlers
Wind invokes these via the WindServiceHandlers dispatcher; each
delegates to Environment::Require<dyn StorageProvider>. Two
scopes: workspace (false) for StorageGet/StorageSet,
global (true) for the rest - VS Code’s storage service
distinguishes the two; we follow.
Layout (one export per file, file name = identity):
StorageGet::StorageGet- single key read (workspace).StorageSet::StorageSet- single key write (workspace).StorageDelete::StorageDelete- single key delete (global).StorageKeys::StorageKeys- list every key (global).StorageGetItems::StorageGetItems- bulk read as[key,value]tuples; called by VS Code’sNativeWorkbenchStorageServiceat boot.StorageUpdateItems::StorageUpdateItems- bulk insert + delete; matchesIndexedDBStorageDatabase’s wire shape.
Modules§
- Storage
Delete - Delete a key from global storage. The
truefirst arg toUpdateStorageValuetargets the global (cross-workspace) store; pairs withStorageKeys/StorageGetItemswhich also read from global. - Storage
Get - Read a single value from persistent storage by key. The
falsefirst arg toGetStorageValueselects the workspace-scoped store;truewould target global storage. - Storage
GetItems - Bulk-read every key/value pair as
[key, value]tuples. VS Code’sNativeWorkbenchStorageServicecalls this exactly once at boot to hydrate its in-memory cache. Stringifies non-string values for wire-shape compatibility with the upstreamStorageDatabasecontract. - Storage
Keys - Return every key in global storage as a JSON array. Used by Wind’s storage-debug surfaces and by extensions iterating the global storage namespace.
- Storage
Set - Write a single value to workspace-scoped storage. Atomic per key - concurrent set/get against the same key serialise through the StorageProvider’s lock.
- Storage
Update Items - Bulk insert + delete in one round-trip. VS Code’s
IndexedDBStorageDatabasebatches every write through this shape:{ insert: [[key,value], …] | { key: value }, delete: [keys…] }. Both insert encodings (array-of-pairs and object-map) accepted.