MCPcopy Index your code
hub / github.com/codeaashu/claude-code / mergePluginErrors

Function mergePluginErrors

src/utils/plugins/refresh.ts:199–209  ·  view source on GitHub ↗

* Merge fresh plugin-load errors with existing errors, preserving LSP and * plugin-component errors that were recorded by other systems and * deduplicating. Same logic as refreshPlugins()/updatePluginState(), extracted * so refresh.ts doesn't leave those errors stranded.

(
  existing: PluginError[],
  fresh: PluginError[],
)

Source from the content-addressed store, hash-verified

197 * so refresh.ts doesn't leave those errors stranded.
198 */
199function mergePluginErrors(
200 existing: PluginError[],
201 fresh: PluginError[],
202): PluginError[] {
203 const preserved = existing.filter(
204 e => e.source === 'lsp-manager' || e.source.startsWith('plugin:'),
205 )
206 const freshKeys = new Set(fresh.map(errorKey))
207 const deduped = preserved.filter(e => !freshKeys.has(errorKey(e)))
208 return [...deduped, ...fresh]
209}
210
211function errorKey(e: PluginError): string {
212 return e.type === 'generic-error'

Callers 1

refreshActivePluginsFunction · 0.85

Calls 2

errorKeyFunction · 0.85
hasMethod · 0.45

Tested by

no test coverage detected