Skip to content

Commit c4641fe

Browse files
committed
Chat cleanup: remove participant and convert some tools to skills
1 parent e8e71ae commit c4641fe

File tree

20 files changed

+286
-1598
lines changed

20 files changed

+286
-1598
lines changed

package.json

Lines changed: 40 additions & 409 deletions
Large diffs are not rendered by default.

package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@
418418
"welcome.github.activePullRequest.contents": "Loading...",
419419
"languageModelTools.github-pull-request_issue_fetch.displayName": "Get a GitHub Issue or pull request",
420420
"languageModelTools.github-pull-request_issue_summarize.displayName": "Summarize a GitHub Issue or pull request",
421+
"languageModelTools.github-pull-request_labels_fetch.displayName": "Fetch labels from a GitHub repository",
421422
"languageModelTools.github-pull-request_notification_fetch.displayName": "Get a GitHub Notification",
422423
"languageModelTools.github-pull-request_notification_summarize.displayName": "Summarize a GitHub Notification",
423424
"languageModelTools.github-pull-request_suggest-fix.displayName": "Suggest a Fix for a GitHub Issue",

src/common/executeCommands.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export namespace contexts {
2626
export namespace commands {
2727
export const OPEN_CHAT = 'workbench.action.chat.open';
2828
export const NEW_CHAT = 'workbench.action.chat.newChat';
29+
export const SHOW_CHAT = 'workbench.panel.chat';
2930
export const CHAT_SETUP_ACTION_ID = 'workbench.action.chat.triggerSetup';
3031

3132
export const QUICK_CHAT_OPEN = 'workbench.action.quickchat.toggle';

src/extension.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import { GitLensIntegration } from './integrations/gitlens/gitlensImpl';
3333
import { IssueFeatureRegistrar } from './issues/issueFeatureRegistrar';
3434
import { StateManager } from './issues/stateManager';
3535
import { IssueContextProvider } from './lm/issueContextProvider';
36-
import { ChatParticipant, ChatParticipantState } from './lm/participants';
3736
import { PullRequestContextProvider } from './lm/pullRequestContextProvider';
3837
import { registerTools } from './lm/tools/tools';
3938
import { migrate } from './migrations';
@@ -300,17 +299,11 @@ async function init(
300299
}
301300

302301
function initChat(context: vscode.ExtensionContext, credentialStore: CredentialStore, reposManager: RepositoriesManager) {
303-
const createParticipant = () => {
304-
const chatParticipantState = new ChatParticipantState();
305-
context.subscriptions.push(new ChatParticipant(context, chatParticipantState));
306-
registerTools(context, credentialStore, reposManager, chatParticipantState);
307-
};
308-
309302
const chatEnabled = () => vscode.workspace.getConfiguration(PR_SETTINGS_NAMESPACE).get<boolean>(EXPERIMENTAL_CHAT, false);
310303
if (chatEnabled()) {
311-
createParticipant();
304+
registerTools(context, credentialStore, reposManager);
312305
} else {
313-
initBasedOnSettingChange(PR_SETTINGS_NAMESPACE, EXPERIMENTAL_CHAT, chatEnabled, createParticipant, context.subscriptions);
306+
initBasedOnSettingChange(PR_SETTINGS_NAMESPACE, EXPERIMENTAL_CHAT, chatEnabled, () => registerTools(context, credentialStore, reposManager), context.subscriptions);
314307
}
315308
}
316309

src/issues/issueFeatureRegistrar.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -565,11 +565,13 @@ export class IssueFeatureRegistrar extends Disposable {
565565
*/
566566
this.telemetry.sendTelemetryEvent('issue.chatSummarizeIssue');
567567
if (issue instanceof IssueModel) {
568-
commands.executeCommand(commands.NEW_CHAT, { inputValue: vscode.l10n.t('@githubpr Summarize issue {0}/{1}#{2}', issue.remote.owner, issue.remote.repositoryName, issue.number) });
568+
commands.executeCommand(commands.NEW_CHAT, { inputValue: vscode.l10n.t('Summarize issue {0}/{1}#{2}', issue.remote.owner, issue.remote.repositoryName, issue.number) });
569+
commands.executeCommand(commands.SHOW_CHAT);
569570
} else {
570571
const pullRequestModel = issue.pullRequestModel;
571572
const remote = pullRequestModel.githubRepository.remote;
572-
commands.executeCommand(commands.NEW_CHAT, { inputValue: vscode.l10n.t('@githubpr Summarize pull request {0}/{1}#{2}', remote.owner, remote.repositoryName, pullRequestModel.number) });
573+
commands.executeCommand(commands.NEW_CHAT, { inputValue: vscode.l10n.t('Summarize pull request {0}/{1}#{2}', remote.owner, remote.repositoryName, pullRequestModel.number) });
574+
commands.executeCommand(commands.SHOW_CHAT);
573575
}
574576
}),
575577
);
@@ -582,7 +584,8 @@ export class IssueFeatureRegistrar extends Disposable {
582584
"issue.chatSuggestFix" : {}
583585
*/
584586
this.telemetry.sendTelemetryEvent('issue.chatSuggestFix');
585-
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) });
587+
commands.executeCommand(commands.NEW_CHAT, { inputValue: vscode.l10n.t('Find a fix for issue {0}/{1}#{2}', issue.remote.owner, issue.remote.repositoryName, issue.number) });
588+
commands.executeCommand(commands.SHOW_CHAT);
586589
}),
587590
);
588591
this._register(vscode.commands.registerCommand('issues.configureIssuesViewlet', async () => {

src/lm/participants.ts

Lines changed: 0 additions & 210 deletions
This file was deleted.

src/lm/participantsPrompt.ts

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)