Skip to content

Commit 2644275

Browse files
Copilotalexr00
andcommitted
Use NEW_CHAT command to create new chat sessions for issue commands
- Updated issue.chatSuggestFix to use commands.NEW_CHAT instead of chatCommand() - Updated issue.chatSummarizeIssue to use commands.NEW_CHAT instead of chatCommand() - Removed unused chatCommand import from lm/utils - Each invocation now creates a new chat session instead of reusing existing one Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent f046337 commit 2644275

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/issues/issueFeatureRegistrar.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ import { IssueModel } from '../github/issueModel';
6666
import { IssueOverviewPanel } from '../github/issueOverview';
6767
import { RepositoriesManager } from '../github/repositoriesManager';
6868
import { ISSUE_OR_URL_EXPRESSION, parseIssueExpressionOutput } from '../github/utils';
69-
import { chatCommand } from '../lm/utils';
7069
import { ReviewManager } from '../view/reviewManager';
7170
import { ReviewsManager } from '../view/reviewsManager';
7271
import { PRNode } from '../view/treeNodes/pullRequestNode';
@@ -523,7 +522,6 @@ export class IssueFeatureRegistrar extends Disposable {
523522
return openCodeLink(issueModel, this.manager);
524523
}),
525524
);
526-
const chatCommandID = chatCommand();
527525
this._register(
528526
vscode.commands.registerCommand('issue.chatSummarizeIssue', (issue: any) => {
529527
if (!(issue instanceof IssueModel || issue instanceof PRNode)) {
@@ -534,11 +532,11 @@ export class IssueFeatureRegistrar extends Disposable {
534532
*/
535533
this.telemetry.sendTelemetryEvent('issue.chatSummarizeIssue');
536534
if (issue instanceof IssueModel) {
537-
commands.executeCommand(chatCommandID, vscode.l10n.t('@githubpr Summarize issue {0}/{1}#{2}', issue.remote.owner, issue.remote.repositoryName, issue.number));
535+
commands.executeCommand(commands.NEW_CHAT, { inputValue: vscode.l10n.t('@githubpr Summarize issue {0}/{1}#{2}', issue.remote.owner, issue.remote.repositoryName, issue.number) });
538536
} else {
539537
const pullRequestModel = issue.pullRequestModel;
540538
const remote = pullRequestModel.githubRepository.remote;
541-
commands.executeCommand(chatCommandID, vscode.l10n.t('@githubpr Summarize pull request {0}/{1}#{2}', remote.owner, remote.repositoryName, pullRequestModel.number));
539+
commands.executeCommand(commands.NEW_CHAT, { inputValue: vscode.l10n.t('@githubpr Summarize pull request {0}/{1}#{2}', remote.owner, remote.repositoryName, pullRequestModel.number) });
542540
}
543541
}),
544542
);
@@ -551,7 +549,7 @@ export class IssueFeatureRegistrar extends Disposable {
551549
"issue.chatSuggestFix" : {}
552550
*/
553551
this.telemetry.sendTelemetryEvent('issue.chatSuggestFix');
554-
commands.executeCommand(chatCommandID, vscode.l10n.t('@githubpr Find a fix for issue {0}/{1}#{2}', issue.remote.owner, issue.remote.repositoryName, issue.number));
552+
commands.executeCommand(commands.NEW_CHAT, { inputValue: vscode.l10n.t('@githubpr Find a fix for issue {0}/{1}#{2}', issue.remote.owner, issue.remote.repositoryName, issue.number) });
555553
}),
556554
);
557555
this._register(vscode.commands.registerCommand('issues.configureIssuesViewlet', async () => {

0 commit comments

Comments
 (0)