fix(vscode): open notebook links in notebook editor (#2373)

This commit is contained in:
TPOB
2026-08-06 21:37:41 +03:00
committed by GitHub
parent bcc64f7586
commit 4bb89bf6a6
2 changed files with 99 additions and 2 deletions
+1 -2
View File
@@ -356,13 +356,12 @@ export async function handleSystemBridgeMessage(
case 'editor:openFile': {
const { path: filePath, line, column } = payload as { path: string; line?: number; column?: number };
try {
const doc = await vscode.workspace.openTextDocument(filePath);
const options: vscode.TextDocumentShowOptions = {};
if (typeof line === 'number') {
const pos = new vscode.Position(Math.max(0, line - 1), column || 0);
options.selection = new vscode.Range(pos, pos);
}
await vscode.window.showTextDocument(doc, options);
await vscode.commands.executeCommand('vscode.open', vscode.Uri.file(filePath), options);
return { id, type, success: true };
} catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error);