Skip to content

Commit 66335ab

Browse files
authored
Merge pull request microsoft#182567 from microsoft/roblou/gothic-monkey
Rename "InteractiveSession" to "Chat"
2 parents c3c6a33 + d1132eb commit 66335ab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1092
-1093
lines changed

build/lib/i18n.resources.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
"project": "vscode-workbench"
164164
},
165165
{
166-
"name": "vs/workbench/contrib/interactiveSession",
166+
"name": "vs/workbench/contrib/chat",
167167
"project": "vscode-workbench"
168168
},
169169
{

src/vs/platform/actions/common/actions.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ export class MenuId {
179179
static readonly MergeBaseToolbar = new MenuId('MergeBaseToolbar');
180180
static readonly MergeInputResultToolbar = new MenuId('MergeToolbarResultToolbar');
181181
static readonly InlineSuggestionToolbar = new MenuId('InlineSuggestionToolbar');
182-
static readonly InteractiveSessionContext = new MenuId('InteractiveSessionContext');
183-
static readonly InteractiveSessionCodeBlock = new MenuId('InteractiveSessionCodeblock');
184-
static readonly InteractiveSessionTitle = new MenuId('InteractiveSessionTitle');
185-
static readonly InteractiveSessionExecute = new MenuId('InteractiveSessionExecute');
182+
static readonly ChatContext = new MenuId('ChatContext');
183+
static readonly ChatCodeBlock = new MenuId('ChatCodeblock');
184+
static readonly ChatTitle = new MenuId('ChatTitle');
185+
static readonly ChatExecute = new MenuId('ChatExecute');
186186

187187
/**
188188
* Create or reuse a `MenuId` with the given identifier

src/vs/workbench/api/browser/extensionHost.contribution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ import './mainThreadNotebookRenderers';
7373
import './mainThreadNotebookSaveParticipant';
7474
import './mainThreadInteractive';
7575
import './mainThreadInteractiveEditor';
76-
import './mainThreadInteractiveSession';
76+
import './mainThreadChat';
7777
import './mainThreadTask';
7878
import './mainThreadLabelService';
7979
import './mainThreadTunnelService';

src/vs/workbench/api/browser/mainThreadInteractiveSession.ts renamed to src/vs/workbench/api/browser/mainThreadChat.ts

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,33 @@ import { Disposable, DisposableMap } from 'vs/base/common/lifecycle';
88
import { URI } from 'vs/base/common/uri';
99
import { ILogService } from 'vs/platform/log/common/log';
1010
import { IProductService } from 'vs/platform/product/common/productService';
11-
import { ExtHostContext, ExtHostInteractiveSessionShape, IInteractiveRequestDto, MainContext, MainThreadInteractiveSessionShape } from 'vs/workbench/api/common/extHost.protocol';
12-
import { IInteractiveSessionWidgetService } from 'vs/workbench/contrib/interactiveSession/browser/interactiveSession';
13-
import { IInteractiveSessionContributionService } from 'vs/workbench/contrib/interactiveSession/common/interactiveSessionContributionService';
14-
import { IInteractiveProgress, IInteractiveRequest, IInteractiveResponse, IInteractiveSession, IInteractiveSessionDynamicRequest, IInteractiveSessionService } from 'vs/workbench/contrib/interactiveSession/common/interactiveSessionService';
11+
import { ExtHostContext, ExtHostChatShape, IChatRequestDto, MainContext, MainThreadChatShape } from 'vs/workbench/api/common/extHost.protocol';
12+
import { IChatWidgetService } from 'vs/workbench/contrib/chat/browser/chat';
13+
import { IChatContributionService } from 'vs/workbench/contrib/chat/common/chatContributionService';
14+
import { IChatProgress, IChatRequest, IChatResponse, IChat, IChatDynamicRequest, IChatService } from 'vs/workbench/contrib/chat/common/chatService';
1515
import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers';
1616

17-
@extHostNamedCustomer(MainContext.MainThreadInteractiveSession)
18-
export class MainThreadInteractiveSession extends Disposable implements MainThreadInteractiveSessionShape {
17+
@extHostNamedCustomer(MainContext.MainThreadChat)
18+
export class MainThreadChat extends Disposable implements MainThreadChatShape {
1919

2020
private readonly _providerRegistrations = this._register(new DisposableMap<number>());
21-
private readonly _activeRequestProgressCallbacks = new Map<string, (progress: IInteractiveProgress) => void>();
21+
private readonly _activeRequestProgressCallbacks = new Map<string, (progress: IChatProgress) => void>();
2222
private readonly _stateEmitters = new Map<number, Emitter<any>>();
2323

24-
private readonly _proxy: ExtHostInteractiveSessionShape;
24+
private readonly _proxy: ExtHostChatShape;
2525

2626
constructor(
2727
extHostContext: IExtHostContext,
28-
@IInteractiveSessionService private readonly _interactiveSessionService: IInteractiveSessionService,
29-
@IInteractiveSessionWidgetService private readonly _interactiveSessionWidgetService: IInteractiveSessionWidgetService,
30-
@IInteractiveSessionContributionService private readonly interactiveSessionContribService: IInteractiveSessionContributionService,
28+
@IChatService private readonly _chatService: IChatService,
29+
@IChatWidgetService private readonly _chatWidgetService: IChatWidgetService,
30+
@IChatContributionService private readonly chatContribService: IChatContributionService,
3131
@IProductService private readonly productService: IProductService,
3232
@ILogService private readonly logService: ILogService,
3333
) {
3434
super();
35-
this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostInteractiveSession);
35+
this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostChat);
3636

37-
this._register(this._interactiveSessionService.onDidPerformUserAction(e => {
37+
this._register(this._chatService.onDidPerformUserAction(e => {
3838
this._proxy.$onDidPerformUserAction(e);
3939
}));
4040
}
@@ -45,7 +45,7 @@ export class MainThreadInteractiveSession extends Disposable implements MainThre
4545
return;
4646
}
4747

48-
const unreg = this._interactiveSessionService.registerSlashCommandProvider({
48+
const unreg = this._chatService.registerSlashCommandProvider({
4949
chatProviderId,
5050
provideSlashCommands: async token => {
5151
return this._proxy.$provideProviderSlashCommands(handle, token);
@@ -62,22 +62,22 @@ export class MainThreadInteractiveSession extends Disposable implements MainThre
6262
this._providerRegistrations.deleteAndDispose(handle);
6363
}
6464

65-
async $registerInteractiveSessionProvider(handle: number, id: string): Promise<void> {
65+
async $registerChatProvider(handle: number, id: string): Promise<void> {
6666
if (this.productService.quality === 'stable') {
6767
this.logService.trace(`The interactive session API is not supported in stable VS Code.`);
6868
return;
6969
}
7070

71-
const registration = this.interactiveSessionContribService.registeredProviders.find(staticProvider => staticProvider.id === id);
71+
const registration = this.chatContribService.registeredProviders.find(staticProvider => staticProvider.id === id);
7272
if (!registration) {
7373
throw new Error(`Provider ${id} must be declared in the package.json.`);
7474
}
7575

76-
const unreg = this._interactiveSessionService.registerProvider({
76+
const unreg = this._chatService.registerProvider({
7777
id,
7878
displayName: registration.label,
7979
prepareSession: async (initialState, token) => {
80-
const session = await this._proxy.$prepareInteractiveSession(handle, initialState, token);
80+
const session = await this._proxy.$prepareChat(handle, initialState, token);
8181
if (!session) {
8282
return undefined;
8383
}
@@ -88,7 +88,7 @@ export class MainThreadInteractiveSession extends Disposable implements MainThre
8888

8989
const emitter = new Emitter<any>();
9090
this._stateEmitters.set(session.id, emitter);
91-
return <IInteractiveSession>{
91+
return <IChat>{
9292
id: session.id,
9393
requesterUsername: session.requesterUsername,
9494
requesterAvatarIconUri: URI.revive(session.requesterAvatarIconUri),
@@ -104,8 +104,8 @@ export class MainThreadInteractiveSession extends Disposable implements MainThre
104104
};
105105
},
106106
resolveRequest: async (session, context, token) => {
107-
const dto = await this._proxy.$resolveInteractiveRequest(handle, session.id, context, token);
108-
return <IInteractiveRequest>{
107+
const dto = await this._proxy.$resolveRequest(handle, session.id, context, token);
108+
return <IChatRequest>{
109109
session,
110110
...dto
111111
};
@@ -114,11 +114,11 @@ export class MainThreadInteractiveSession extends Disposable implements MainThre
114114
const id = `${handle}_${request.session.id}`;
115115
this._activeRequestProgressCallbacks.set(id, progress);
116116
try {
117-
const requestDto: IInteractiveRequestDto = {
117+
const requestDto: IChatRequestDto = {
118118
message: request.message,
119119
};
120-
const dto = await this._proxy.$provideInteractiveReply(handle, request.session.id, requestDto, token);
121-
return <IInteractiveResponse>{
120+
const dto = await this._proxy.$provideReply(handle, request.session.id, requestDto, token);
121+
return <IChatResponse>{
122122
session: request.session,
123123
...dto
124124
};
@@ -140,27 +140,27 @@ export class MainThreadInteractiveSession extends Disposable implements MainThre
140140
this._providerRegistrations.set(handle, unreg);
141141
}
142142

143-
$acceptInteractiveResponseProgress(handle: number, sessionId: number, progress: IInteractiveProgress): void {
143+
$acceptResponseProgress(handle: number, sessionId: number, progress: IChatProgress): void {
144144
const id = `${handle}_${sessionId}`;
145145
this._activeRequestProgressCallbacks.get(id)?.(progress);
146146
}
147147

148-
async $acceptInteractiveSessionState(sessionId: number, state: any): Promise<void> {
148+
async $acceptChatState(sessionId: number, state: any): Promise<void> {
149149
this._stateEmitters.get(sessionId)?.fire(state);
150150
}
151151

152-
$addInteractiveSessionRequest(context: any): void {
153-
this._interactiveSessionService.addInteractiveRequest(context);
152+
$addRequest(context: any): void {
153+
this._chatService.addRequest(context);
154154
}
155155

156-
async $sendInteractiveRequestToProvider(providerId: string, message: IInteractiveSessionDynamicRequest): Promise<void> {
157-
const widget = await this._interactiveSessionWidgetService.revealViewForProvider(providerId);
156+
async $sendRequestToProvider(providerId: string, message: IChatDynamicRequest): Promise<void> {
157+
const widget = await this._chatWidgetService.revealViewForProvider(providerId);
158158
if (widget && widget.viewModel) {
159-
this._interactiveSessionService.sendInteractiveRequestToProvider(widget.viewModel.sessionId, message);
159+
this._chatService.sendRequestToProvider(widget.viewModel.sessionId, message);
160160
}
161161
}
162162

163-
async $unregisterInteractiveSessionProvider(handle: number): Promise<void> {
163+
async $unregisterChatProvider(handle: number): Promise<void> {
164164
this._providerRegistrations.deleteAndDispose(handle);
165165
}
166166
}

src/vs/workbench/api/common/extHost.api.impl.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ import { IExtHostLocalizationService } from 'vs/workbench/api/common/extHostLoca
9797
import { EditSessionIdentityMatch } from 'vs/platform/workspace/common/editSessions';
9898
import { ExtHostProfileContentHandlers } from 'vs/workbench/api/common/extHostProfileContentHandler';
9999
import { ExtHostQuickDiff } from 'vs/workbench/api/common/extHostQuickDiff';
100-
import { ExtHostInteractiveSession } from 'vs/workbench/api/common/extHostInteractiveSession';
100+
import { ExtHostChat } from 'vs/workbench/api/common/extHostChat';
101101
import { ExtHostInteractiveEditor } from 'vs/workbench/api/common/extHostInteractiveEditor';
102102
import { ExtHostNotebookDocumentSaveParticipant } from 'vs/workbench/api/common/extHostNotebookDocumentSaveParticipant';
103103
import { ExtHostSemanticSimilarity } from 'vs/workbench/api/common/extHostSemanticSimilarity';
@@ -201,7 +201,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
201201
const extHostProfileContentHandlers = rpcProtocol.set(ExtHostContext.ExtHostProfileContentHandlers, new ExtHostProfileContentHandlers(rpcProtocol));
202202
rpcProtocol.set(ExtHostContext.ExtHostInteractive, new ExtHostInteractive(rpcProtocol, extHostNotebook, extHostDocumentsAndEditors, extHostCommands, extHostLogService));
203203
const extHostInteractiveEditor = rpcProtocol.set(ExtHostContext.ExtHostInteractiveEditor, new ExtHostInteractiveEditor(rpcProtocol, extHostDocuments, extHostLogService));
204-
const extHostInteractiveSession = rpcProtocol.set(ExtHostContext.ExtHostInteractiveSession, new ExtHostInteractiveSession(rpcProtocol, extHostLogService));
204+
const extHostChat = rpcProtocol.set(ExtHostContext.ExtHostChat, new ExtHostChat(rpcProtocol, extHostLogService));
205205
const extHostSemanticSimilarity = rpcProtocol.set(ExtHostContext.ExtHostSemanticSimilarity, new ExtHostSemanticSimilarity(rpcProtocol));
206206
const extHostIssueReporter = rpcProtocol.set(ExtHostContext.ExtHostIssueReporter, new ExtHostIssueReporter(rpcProtocol));
207207

@@ -1275,26 +1275,26 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
12751275
},
12761276
registerInteractiveSessionProvider(id: string, provider: vscode.InteractiveSessionProvider) {
12771277
checkProposedApiEnabled(extension, 'interactive');
1278-
return extHostInteractiveSession.registerInteractiveSessionProvider(extension, id, provider);
1278+
return extHostChat.registerChatProvider(extension, id, provider);
12791279
},
12801280
addInteractiveRequest(context: vscode.InteractiveSessionRequestArgs) {
12811281
checkProposedApiEnabled(extension, 'interactive');
1282-
return extHostInteractiveSession.addInteractiveSessionRequest(context);
1282+
return extHostChat.addChatRequest(context);
12831283
},
12841284
sendInteractiveRequestToProvider(providerId: string, message: vscode.InteractiveSessionDynamicRequest) {
12851285
checkProposedApiEnabled(extension, 'interactive');
1286-
return extHostInteractiveSession.sendInteractiveRequestToProvider(providerId, message);
1286+
return extHostChat.sendInteractiveRequestToProvider(providerId, message);
12871287
},
12881288
get onDidPerformUserAction() {
1289-
return extHostInteractiveSession.onDidPerformUserAction;
1289+
return extHostChat.onDidPerformUserAction;
12901290
}
12911291
};
12921292

12931293
// namespace: interactiveSlashCommands
12941294
const interactiveSlashCommands: typeof vscode.interactiveSlashCommands = {
12951295
registerSlashCommandProvider(chatProviderId: string, provider: vscode.InteractiveSlashCommandProvider) {
12961296
checkProposedApiEnabled(extension, 'interactiveSlashCommands');
1297-
return extHostInteractiveSession.registerSlashCommandProvider(extension, chatProviderId, provider);
1297+
return extHostChat.registerSlashCommandProvider(extension, chatProviderId, provider);
12981298
}
12991299
};
13001300

0 commit comments

Comments
 (0)