import { ExtensionSlot } from './API' export function invokeSlotCallbacks(slot: ExtensionSlot<(...args: T) => void | Promise>, ...args: T): void { const slotItems = slot.getItems() if (slot.host.options.monitoring.disableMonitoring) { slotItems.forEach(slotItem => { try { slotItem.contribution(...args) } catch (e) { console.error(e) } }) } else { slotItems.forEach(slotItem => { const messageId = `${slot.host}-${slot.name}:${slotItem.shell.name}${slotItem.name && '-' + slotItem.name}` slotItem.shell.log.monitor(messageId, {}, () => slotItem.contribution(...args)) }) } }