Fix paste function in chat box

This commit is contained in:
erwinh22
2025-06-19 16:50:42 -04:00
parent a0bbc5764e
commit 09073de9f2
4 changed files with 3261 additions and 7 deletions

View File

@@ -206,6 +206,9 @@ class ClaudeChatProvider {
case 'updateSettings':
this._updateSettings(message.settings);
return;
case 'getClipboardText':
this._getClipboardText();
return;
}
},
null,
@@ -1146,6 +1149,18 @@ class ClaudeChatProvider {
}
}
private async _getClipboardText(): Promise<void> {
try {
const text = await vscode.env.clipboard.readText();
this._panel?.webview.postMessage({
type: 'clipboardText',
data: text
});
} catch (error) {
console.error('Failed to read clipboard:', error);
}
}
public dispose() {
if (this._panel) {
this._panel.dispose();