Skip to content

Commit 8cb568f

Browse files
author
ityaozm@gmail.com
committed
fix(app): Fix copilot explain command output
- Commented out unnecessary code - Uncommented code to run copilot explain command and capture output - Updated code to handle output and display it properly
1 parent 4852c89 commit 8cb568f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

app/Generators/GithubCopilotCliGenerator.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ public function generate(string $prompt): string
6262

6363

6464
EOF;
65-
// $output = resolve(
66-
// Process::class,
67-
// ['command' => [$this->config['binary'], 'copilot', 'explain', $prompt]] + $this->config['parameters']
68-
// )->mustRun(function (string $type, string $data): void {
69-
// Process::OUT === $type ? $this->outputStyle->write($data) : $this->outputStyle->write("<fg=red>$data</>");
70-
// })->getOutput();
65+
$output = resolve(
66+
Process::class,
67+
['command' => [$this->config['binary'], 'copilot', 'explain', $prompt]] + $this->config['parameters']
68+
)->mustRun(function (string $type, string $data): void {
69+
Process::OUT === $type ? $this->outputStyle->write($data) : $this->outputStyle->write("<fg=red>$data</>");
70+
})->getOutput();
7171

7272
return str($output)->match('/\{.*\}/s')->__toString();
7373
}

0 commit comments

Comments
 (0)