Skip to main content

Module Loading

Module Loading 

Source
Expand description

Configuration loading, caching, and merging.

Provides the three public entry points consumed by the rest of the ConfigurationProvider module:

  • read_and_parse_configuration_file - reads a single settings.json from disk via the async ApplicationRunTime, with a 250 ms TTL parse cache to avoid redundant disk reads during burst Inspect calls.
  • initialize_and_merge_configurations - rebuilds the merged GlobalConfiguration by layering Default β†’ User β†’ Workspace in precedence order (deep-merge for nested objects, shallow for root keys).
  • collect_default_configurations - walks every scanned extension’s contributes.configuration.properties map and extracts default values, inserting them into a nested map keyed by dotted path.
  • ClearSettingsFileCache - invalidates the parse cache; called by UpdateValue after any write so the next read sees fresh content.

StructsΒ§

CachedSettingsValue πŸ”’

ConstantsΒ§

SETTINGS_FILE_CACHE_TTL_MS πŸ”’
Short TTL cache for parsed settings.json reads. The InspectConfigurationValue handler reads BOTH the user settings.json and the workspace settings.json on every call; log audit 20260501T053137 shows ~57 Inspect calls per session = 114 disk reads of the same one or two files. With this cache, repeated reads within TTL_MS reuse the parsed Value and a burst of Inspects collapses to ~1 disk read per file. TTL is short enough (250ms) that user edits to settings.json show up within a quarter-second.

FunctionsΒ§

ClearSettingsFileCache
Drop every cached settings.json parse. Caller: any code path that mutates settings (UpdateConfigurationValue, initialize_and_merge_configurations).
InsertDottedDefault πŸ”’
Insert a value into target at the dotted path git.enabled, creating intermediate object nodes as needed. Mirrors inspect_configuration_value’s try_fold traversal so a lookup for git.enabled finds target["git"]["enabled"].
SettingsFileCache πŸ”’
collect_default_configurations πŸ”’
Collects default configurations from all installed extensions.
initialize_and_merge_configurations
Logic to load and merge all configuration files into the effective configuration stored in ApplicationState.
read_and_parse_configuration_file πŸ”’
An internal helper to read and parse a single JSON configuration file.