helper add
Generate a typed helper for a common runtime concern.
vsceasy helper add --kind secrets| Flag | Type | Notes |
|---|---|---|
--kind | secrets | config | state | notifications | cache | colorize | Required. Which helper. |
--force | boolean | Overwrite an existing helper file. |
| Kind | Wraps |
|---|---|
secrets | context.secrets (typed get/set/delete). Wire initSecrets(context). |
config | workspace.getConfiguration(...) with typed keys. |
state | globalState / workspaceState. Wire initState(context). |
notifications | info / warning / error message helpers. |
cache | in-memory TTL + LRU cache with a wrap(key, fn) helper. |
colorize | applyTokenColors / removeTokenColors — scoped TextMate colors for your own language. |
The config helper exposes its settings prefix as config.section, so callers
that need the fully-qualified key (opening the Settings UI at a section, for
instance) don’t hardcode the prefix twice.
Examples
Section titled “Examples”vsceasy helper add --kind configvsceasy helper add --kind secretsvsceasy helper add --kind cachevsceasy helper add --kind colorizeimport { createCache } from '../helpers/cache';
const cache = createCache<User>({ ttlMs: 60_000, max: 200 });const u = await cache.wrap('user:' + id, () => orm(User).findById(id));