File name better

This commit is contained in:
andrepimenta
2025-06-24 02:53:54 +01:00
parent 8b0bc2904b
commit e97062ae03
3 changed files with 90 additions and 4 deletions

View File

@@ -231,6 +231,9 @@ class ClaudeChatProvider {
case 'dismissWSLAlert':
this._dismissWSLAlert();
return;
case 'openFile':
this._openFileInEditor(message.filePath);
return;
}
},
null,
@@ -1371,6 +1374,17 @@ class ClaudeChatProvider {
this._context.globalState.update('wslAlertDismissed', true);
}
private async _openFileInEditor(filePath: string) {
try {
const uri = vscode.Uri.file(filePath);
const document = await vscode.workspace.openTextDocument(uri);
await vscode.window.showTextDocument(document, vscode.ViewColumn.One);
} catch (error) {
vscode.window.showErrorMessage(`Failed to open file: ${filePath}`);
console.error('Error opening file:', error);
}
}
public dispose() {
if (this._panel) {
this._panel.dispose();