Skip to main content

Module ExtensionsGetInstalled

Module ExtensionsGetInstalled 

Source
Expand description

extensions:getInstalled(type?) - return scanned extensions reshaped as VS Code’s ILocalExtension[] so ExtensionManagementChannelClient .getInstalled can destructure extension.identifier.id, extension.manifest.*, and extension.location without blowing up.

§Argument contract

Arguments[0] is the optional ExtensionType filter VS Code passes:

  • 0 (System) → only built-ins.
  • 1 (User) → only VSIX-installed.
  • null / missing → every known extension.

Without the filter the trusted-publishers boot migration iterates User-typed extensions over System manifests and crashes on manifest.publisher.toLowerCase().

§Boot-time race

The workbench fires getInstalled ~13 times within the first second. ExtensionPopulate runs in parallel and writes to ScannedExtensions 250-500 ms in. We await ExtensionState.ScanReady (a tokio::sync::Notify fired once the scan commits its results) with a 5 s hard cap, then return whatever is available. No 50 ms polling loop - we wake exactly when data arrives.

§Manifest skeleton

VS Code unconditionally calls manifest.publisher.toLowerCase(). A null or non-object manifest crashes the webview before its first paint. We coerce to {} and inject publisher/name/version defaults.

Constants§

EXTENSION_TYPE_SYSTEM 🔒
EXTENSION_TYPE_USER 🔒
SCAN_WAIT_CAP_MS 🔒

Statics§

INSTALLED_CACHE 🔒

Functions§

CacheIndex 🔒
Fn