diff options
| author | GitHub Action <[email protected]> | 2025-11-08 01:59:02 +0000 |
|---|---|---|
| committer | GitHub Action <[email protected]> | 2025-11-08 01:59:02 +0000 |
| commit | 34ff87d504836ff71b3bb2d466842c00ee3c5ec2 (patch) | |
| tree | cc8ac777f2f082ff676b179017c7dc0f3270314b /sdks | |
| parent | 16357e804145b7f96a2a53badb7dcb6c5453dafe (diff) | |
| download | opencode-34ff87d504836ff71b3bb2d466842c00ee3c5ec2.tar.gz opencode-34ff87d504836ff71b3bb2d466842c00ee3c5ec2.zip | |
chore: format code
Diffstat (limited to 'sdks')
| -rw-r--r-- | sdks/vscode/src/extension.ts | 67 |
1 files changed, 29 insertions, 38 deletions
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) |
