(host: SlashCommandHost)
| 12 | } |
| 13 | |
| 14 | export async function handleReloadCommand(host: SlashCommandHost): Promise<void> { |
| 15 | const tuiConfig = await loadTuiConfig(); |
| 16 | const session = host.session; |
| 17 | |
| 18 | if (session !== undefined) { |
| 19 | await session.reloadSession({ forcePluginSessionStartReminder: true }); |
| 20 | await host.reloadCurrentSessionView(session, 'Session reloaded.'); |
| 21 | } |
| 22 | |
| 23 | const config = await host.harness.getConfig({ reload: true }); |
| 24 | setExperimentalFeatures(await host.harness.getExperimentalFeatures()); |
| 25 | host.refreshSlashCommandAutocomplete(); |
| 26 | applyRuntimeConfig(host, config); |
| 27 | await applyReloadedTuiConfig(host, tuiConfig); |
| 28 | |
| 29 | if (session === undefined) { |
| 30 | host.showStatus( |
| 31 | 'Runtime and TUI config reloaded; no active session.', |
| 32 | 'success', |
| 33 | ); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | export async function applyReloadedTuiConfig( |
| 38 | host: SlashCommandHost, |
no test coverage detected