From 34ff87d504836ff71b3bb2d466842c00ee3c5ec2 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 8 Nov 2025 01:59:02 +0000 Subject: chore: format code --- sdks/vscode/src/extension.ts | 67 +++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 38 deletions(-) (limited to 'sdks/vscode') diff --git a/sdks/vscode/src/extension.ts b/sdks/vscode/src/extension.ts index 2f90229d5..63d8d332e 100644 --- a/sdks/vscode/src/extension.ts +++ b/sdks/vscode/src/extension.ts @@ -6,48 +6,39 @@ import * as vscode from "vscode" const TERMINAL_NAME = "opencode" export function activate(context: vscode.ExtensionContext) { - let openNewTerminalDisposable = vscode.commands.registerCommand( - "opencode.openNewTerminal", - async () => { - await openTerminal() - }, - ) - - let openTerminalDisposable = vscode.commands.registerCommand( - "opencode.openTerminal", - async () => { - // An opencode terminal already exists => focus it - const existingTerminal = vscode.window.terminals.find((t) => t.name === TERMINAL_NAME) - if (existingTerminal) { - existingTerminal.show() - return - } + let openNewTerminalDisposable = vscode.commands.registerCommand("opencode.openNewTerminal", async () => { + await openTerminal() + }) + + let openTerminalDisposable = vscode.commands.registerCommand("opencode.openTerminal", async () => { + // An opencode terminal already exists => focus it + const existingTerminal = vscode.window.terminals.find((t) => t.name === TERMINAL_NAME) + if (existingTerminal) { + existingTerminal.show() + return + } - await openTerminal() - }, - ) + await openTerminal() + }) - let addFilepathDisposable = vscode.commands.registerCommand( - "opencode.addFilepathToTerminal", - async () => { - const fileRef = getActiveFile() - if (!fileRef) { - return - } + let addFilepathDisposable = vscode.commands.registerCommand("opencode.addFilepathToTerminal", async () => { + const fileRef = getActiveFile() + if (!fileRef) { + return + } - const terminal = vscode.window.activeTerminal - if (!terminal) { - return - } + const terminal = vscode.window.activeTerminal + if (!terminal) { + return + } - if (terminal.name === TERMINAL_NAME) { - // @ts-ignore - const port = terminal.creationOptions.env?.["_EXTENSION_OPENCODE_PORT"] - port ? await appendPrompt(parseInt(port), fileRef) : terminal.sendText(fileRef) - terminal.show() - } - }, - ) + if (terminal.name === TERMINAL_NAME) { + // @ts-ignore + const port = terminal.creationOptions.env?.["_EXTENSION_OPENCODE_PORT"] + port ? await appendPrompt(parseInt(port), fileRef) : terminal.sendText(fileRef) + terminal.show() + } + }) context.subscriptions.push(openTerminalDisposable, addFilepathDisposable) -- cgit v1.2.3