Add theme based syntax highlighting for code blocks

This commit is contained in:
Saoud Rizwan
2024-07-21 12:04:18 -04:00
parent 6e96dc529b
commit c11ab41d01
11 changed files with 1725 additions and 44 deletions

View File

@@ -52,6 +52,14 @@ export class SidebarProvider implements vscode.WebviewViewProvider {
}
})
// Listen for when color changes
vscode.workspace.onDidChangeConfiguration((e) => {
if (e.affectsConfiguration("workbench.colorTheme")) {
// Sends latest theme name to webview
this.postStateToWebview()
}
})
// if the extension is starting a new session, clear previous task state
this.clearTask()
}
@@ -215,7 +223,13 @@ export class SidebarProvider implements vscode.WebviewViewProvider {
])
this.postMessageToWebview({
type: "state",
state: { didOpenOnce: !!didOpenOnce, apiKey, maxRequestsPerTask, claudeMessages },
state: {
didOpenOnce: !!didOpenOnce,
apiKey,
maxRequestsPerTask,
themeName: vscode.workspace.getConfiguration("workbench").get<string>("colorTheme"),
claudeMessages,
},
})
}