feat: implement Shiki theme support for VS Code webview and enhance theme handling

This commit is contained in:
Bohdan Triapitsyn
2025-12-15 02:29:39 +02:00
parent 453ac9c706
commit bd25787b92
10 changed files with 467 additions and 23 deletions
+15
View File
@@ -37,6 +37,21 @@ export function activate(context: vscode.ExtensionContext) {
})
);
// Theme changes can update the `workbench.colorTheme` setting slightly after the
// `activeColorTheme` event. Listen for config changes too so we can re-resolve
// the contributed theme JSON and update Shiki themes in the webview.
context.subscriptions.push(
vscode.workspace.onDidChangeConfiguration((event) => {
if (
event.affectsConfiguration('workbench.colorTheme') ||
event.affectsConfiguration('workbench.preferredLightColorTheme') ||
event.affectsConfiguration('workbench.preferredDarkColorTheme')
) {
chatViewProvider?.updateTheme(vscode.window.activeColorTheme.kind);
}
})
);
// Subscribe to status changes
context.subscriptions.push(
openCodeManager.onStatusChange((status, error) => {