Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'editors/code/src/commands.ts')
| -rw-r--r-- | editors/code/src/commands.ts | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts index c0d68881c2..1e74158b82 100644 --- a/editors/code/src/commands.ts +++ b/editors/code/src/commands.ts @@ -1132,27 +1132,24 @@ export function linkToCommand(_: Ctx): Cmd { export function viewMemoryLayout(ctx: CtxInit): Cmd { return async () => { - const editor = vscode.window.activeTextEditor; if (!editor) return ""; const client = ctx.client; const position = editor.selection.active; const expanded = await client.sendRequest(ra.viewRecursiveMemoryLayout, { - textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier( - editor.document - ), + textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(editor.document), position, }); // if (expanded == null) return "Not available"; - const document = vscode.window.createWebviewPanel( "memory_layout", "[Memory Layout]", vscode.ViewColumn.Two, - { enableScripts: true, }); + { enableScripts: true } + ); document.webview.html = `<!DOCTYPE html> <html lang="en"> @@ -1407,7 +1404,7 @@ locate() })() </script> -</html>` +</html>`; ctx.pushExtCleanup(document); }; |