MCPcopy
hub / github.com/claude-code-best/claude-code / clearPluginCache

Function clearPluginCache

src/utils/plugins/pluginLoader.ts:3228–3246  ·  view source on GitHub ↗
(reason?: string)

Source from the content-addressed store, hash-verified

3226 * - When debugging plugin loading issues
3227 */
3228export function clearPluginCache(reason?: string): void {
3229 if (reason) {
3230 logForDebugging(
3231 `clearPluginCache: invalidating loadAllPlugins cache (${reason})`,
3232 )
3233 }
3234 loadAllPlugins.cache?.clear?.()
3235 loadAllPluginsCacheOnly.cache?.clear?.()
3236 // If a plugin previously contributed settings, the session settings cache
3237 // holds a merged result that includes them. cachePluginSettings() on reload
3238 // won't bust the cache when the new base is empty (the startup perf win),
3239 // so bust it here to drop stale plugin overrides. When the base is already
3240 // undefined (startup, or no prior plugin settings) this is a no-op.
3241 if (getPluginSettingsBase() !== undefined) {
3242 resetSettingsCache()
3243 }
3244 clearPluginSettingsBase()
3245 // TODO: Clear installed plugins cache when installedPluginsManager is implemented
3246}
3247
3248/**
3249 * Merge settings from all enabled plugins into a single record.

Callers 6

runFunction · 0.85
performStartupChecksFunction · 0.85
clearAllPluginCachesFunction · 0.85
setupPluginHookHotReloadFunction · 0.85

Calls 5

getPluginSettingsBaseFunction · 0.85
resetSettingsCacheFunction · 0.85
clearPluginSettingsBaseFunction · 0.85
logForDebuggingFunction · 0.50
clearMethod · 0.45

Tested by

no test coverage detected