Skip to content

Commit bb3607c

Browse files
committed
Rename actions, config, and some properties/variables
1 parent 2156969 commit bb3607c

File tree

12 files changed

+71
-71
lines changed

12 files changed

+71
-71
lines changed

src/vs/workbench/api/browser/mainThreadChat.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ export class MainThreadChat extends Disposable implements MainThreadChatShape {
2525

2626
constructor(
2727
extHostContext: IExtHostContext,
28-
@IChatService private readonly _interactiveSessionService: IChatService,
29-
@IChatWidgetService private readonly _interactiveSessionWidgetService: IChatWidgetService,
30-
@IChatContributionService private readonly interactiveSessionContribService: IChatContributionService,
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();
3535
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 MainThreadChat extends Disposable implements MainThreadChatShape {
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);
@@ -68,12 +68,12 @@ export class MainThreadChat extends Disposable implements MainThreadChatShape {
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) => {
@@ -150,13 +150,13 @@ export class MainThreadChat extends Disposable implements MainThreadChatShape {
150150
}
151151

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

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

src/vs/workbench/api/common/extHostChat.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ class ChatProviderWrapper<T> {
3131
export class ExtHostChat implements ExtHostChatShape {
3232
private static _nextId = 0;
3333

34-
private readonly _interactiveSessionProvider = new Map<number, ChatProviderWrapper<vscode.InteractiveSessionProvider>>();
34+
private readonly _chatProvider = new Map<number, ChatProviderWrapper<vscode.InteractiveSessionProvider>>();
3535
private readonly _slashCommandProvider = new Map<number, ChatProviderWrapper<vscode.InteractiveSlashCommandProvider>>();
36-
private readonly _interactiveSessions = new Map<number, vscode.InteractiveSession>();
36+
private readonly _chatSessions = new Map<number, vscode.InteractiveSession>();
3737
// private readonly _providerResponsesByRequestId = new Map<number, { response: vscode.ProviderResult<vscode.InteractiveResponse | vscode.InteractiveResponseForProgress>; sessionId: number }>();
3838

3939
private readonly _onDidPerformUserAction = new Emitter<vscode.InteractiveSessionUserActionEvent>();
@@ -52,11 +52,11 @@ export class ExtHostChat implements ExtHostChatShape {
5252

5353
registerChatProvider(extension: Readonly<IRelaxedExtensionDescription>, id: string, provider: vscode.InteractiveSessionProvider): vscode.Disposable {
5454
const wrapper = new ChatProviderWrapper(extension, provider);
55-
this._interactiveSessionProvider.set(wrapper.handle, wrapper);
55+
this._chatProvider.set(wrapper.handle, wrapper);
5656
this._proxy.$registerChatProvider(wrapper.handle, id);
5757
return toDisposable(() => {
5858
this._proxy.$unregisterChatProvider(wrapper.handle);
59-
this._interactiveSessionProvider.delete(wrapper.handle);
59+
this._chatProvider.delete(wrapper.handle);
6060
});
6161
}
6262

@@ -69,7 +69,7 @@ export class ExtHostChat implements ExtHostChatShape {
6969
}
7070

7171
async $prepareChat(handle: number, initialState: any, token: CancellationToken): Promise<IChatDto | undefined> {
72-
const entry = this._interactiveSessionProvider.get(handle);
72+
const entry = this._chatProvider.get(handle);
7373
if (!entry) {
7474
return undefined;
7575
}
@@ -80,7 +80,7 @@ export class ExtHostChat implements ExtHostChatShape {
8080
}
8181

8282
const id = ExtHostChat._nextId++;
83-
this._interactiveSessions.set(id, session);
83+
this._chatSessions.set(id, session);
8484

8585
return {
8686
id,
@@ -93,12 +93,12 @@ export class ExtHostChat implements ExtHostChatShape {
9393
}
9494

9595
async $resolveRequest(handle: number, sessionId: number, context: any, token: CancellationToken): Promise<Omit<IChatRequestDto, 'id'> | undefined> {
96-
const entry = this._interactiveSessionProvider.get(handle);
96+
const entry = this._chatProvider.get(handle);
9797
if (!entry) {
9898
return undefined;
9999
}
100100

101-
const realSession = this._interactiveSessions.get(sessionId);
101+
const realSession = this._chatSessions.get(sessionId);
102102
if (!realSession) {
103103
return undefined;
104104
}
@@ -117,7 +117,7 @@ export class ExtHostChat implements ExtHostChatShape {
117117
}
118118

119119
async $provideWelcomeMessage(handle: number, token: CancellationToken): Promise<(string | IChatReplyFollowup[])[] | undefined> {
120-
const entry = this._interactiveSessionProvider.get(handle);
120+
const entry = this._chatProvider.get(handle);
121121
if (!entry) {
122122
return undefined;
123123
}
@@ -140,12 +140,12 @@ export class ExtHostChat implements ExtHostChatShape {
140140
}
141141

142142
async $provideFollowups(handle: number, sessionId: number, token: CancellationToken): Promise<IChatFollowup[] | undefined> {
143-
const entry = this._interactiveSessionProvider.get(handle);
143+
const entry = this._chatProvider.get(handle);
144144
if (!entry) {
145145
return undefined;
146146
}
147147

148-
const realSession = this._interactiveSessions.get(sessionId);
148+
const realSession = this._chatSessions.get(sessionId);
149149
if (!realSession) {
150150
return;
151151
}
@@ -159,12 +159,12 @@ export class ExtHostChat implements ExtHostChatShape {
159159
}
160160

161161
async $provideReply(handle: number, sessionId: number, request: IChatRequestDto, token: CancellationToken): Promise<IChatResponseDto | undefined> {
162-
const entry = this._interactiveSessionProvider.get(handle);
162+
const entry = this._chatProvider.get(handle);
163163
if (!entry) {
164164
return undefined;
165165
}
166166

167-
const realSession = this._interactiveSessions.get(sessionId);
167+
const realSession = this._chatSessions.get(sessionId);
168168
if (!realSession) {
169169
return;
170170
}
@@ -202,7 +202,7 @@ export class ExtHostChat implements ExtHostChatShape {
202202

203203
try {
204204
// Check that the session has not been released since the request started
205-
if (realSession.saveState && this._interactiveSessions.has(sessionId)) {
205+
if (realSession.saveState && this._chatSessions.has(sessionId)) {
206206
const newState = realSession.saveState();
207207
this._proxy.$acceptChatState(sessionId, newState);
208208
}
@@ -215,12 +215,12 @@ export class ExtHostChat implements ExtHostChatShape {
215215
}
216216

217217
async $provideSlashCommands(handle: number, sessionId: number, token: CancellationToken): Promise<ISlashCommand[] | undefined> {
218-
const entry = this._interactiveSessionProvider.get(handle);
218+
const entry = this._chatProvider.get(handle);
219219
if (!entry) {
220220
return undefined;
221221
}
222222

223-
const realSession = this._interactiveSessions.get(sessionId);
223+
const realSession = this._chatSessions.get(sessionId);
224224
if (!realSession) {
225225
return undefined;
226226
}
@@ -237,7 +237,7 @@ export class ExtHostChat implements ExtHostChatShape {
237237
}
238238

239239
$releaseSession(sessionId: number) {
240-
this._interactiveSessions.delete(sessionId);
240+
this._chatSessions.delete(sessionId);
241241
}
242242

243243
async $onDidPerformUserAction(event: IChatUserActionEvent): Promise<void> {

src/vs/workbench/contrib/chat/browser/actions/chatActions.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function registerChatActions() {
3535
registerEditorAction(class ChatAcceptInput extends EditorAction {
3636
constructor() {
3737
super({
38-
id: 'interactiveSession.action.acceptInput',
38+
id: 'chat.action.acceptInput',
3939
label: localize({ key: 'actions.chat.acceptInput', comment: ['Apply input from the chat input box'] }, "Accept Chat Input"),
4040
alias: 'Accept Chat Input',
4141
precondition: CONTEXT_IN_INTERACTIVE_INPUT,
@@ -59,7 +59,7 @@ export function registerChatActions() {
5959
registerAction2(class ClearEditorAction extends Action2 {
6060
constructor() {
6161
super({
62-
id: 'workbench.action.interactiveSessionEditor.clear',
62+
id: 'workbench.action.chatEditor.clear',
6363
title: {
6464
value: localize('interactiveSession.clear.label', "Clear"),
6565
original: 'Clear'
@@ -89,7 +89,7 @@ export function registerChatActions() {
8989
registerAction2(class ClearEditorAction extends Action2 {
9090
constructor() {
9191
super({
92-
id: 'workbench.action.interactiveSessionEditor.clearHistory',
92+
id: 'workbench.action.chatEditor.clearHistory',
9393
title: {
9494
value: localize('interactiveSession.clearHistory.label', "Clear Input History"),
9595
original: 'Clear Input History'
@@ -107,7 +107,7 @@ export function registerChatActions() {
107107
registerEditorAction(class FocusChatAction extends EditorAction {
108108
constructor() {
109109
super({
110-
id: 'interactiveSession.action.focus',
110+
id: 'chat.action.focus',
111111
label: localize('actions.interactiveSession.focus', "Focus Interactive Session"),
112112
alias: 'Focus Interactive Session',
113113
precondition: CONTEXT_IN_INTERACTIVE_INPUT,
@@ -131,7 +131,7 @@ export function registerChatActions() {
131131
registerEditorAction(class AccessibilityHelpChatAction extends EditorAction {
132132
constructor() {
133133
super({
134-
id: 'interactiveSession.action.accessibilityHelp',
134+
id: 'chat.action.accessibilityHelp',
135135
label: localize('actions.interactiveSession.accessibiltyHelp', "Chat View Accessibility Help"),
136136
alias: 'Chat View Accessibility Help',
137137
precondition: CONTEXT_IN_INTERACTIVE_INPUT,
@@ -183,7 +183,7 @@ export function registerChatActions() {
183183
registerAction2(class FocusChatInputAction extends Action2 {
184184
constructor() {
185185
super({
186-
id: 'workbench.action.interactiveSession.focusInput',
186+
id: 'workbench.action.chat.focusInput',
187187
title: {
188188
value: localize('interactiveSession.focusInput.label', "Focus Input"),
189189
original: 'Focus Input'
@@ -205,7 +205,7 @@ export function registerChatActions() {
205205
registerAction2(class GlobalClearChatAction extends Action2 {
206206
constructor() {
207207
super({
208-
id: `workbench.action.interactiveSession.clear`,
208+
id: `workbench.action.chat.clear`,
209209
title: {
210210
value: localize('interactiveSession.clear.label', "Clear"),
211211
original: 'Clear'
@@ -259,7 +259,7 @@ export function getOpenChatEditorAction(id: string, label: string, when?: string
259259

260260
const getClearChatActionDescriptorForViewTitle = (viewId: string, providerId: string): Readonly<IAction2Options> & { viewId: string } => ({
261261
viewId,
262-
id: `workbench.action.interactiveSession.${providerId}.clear`,
262+
id: `workbench.action.chat.${providerId}.clear`,
263263
title: {
264264
value: localize('interactiveSession.clear.label', "Clear"),
265265
original: 'Clear'
@@ -289,7 +289,7 @@ export function getClearAction(viewId: string, providerId: string) {
289289

290290
const getHistoryChatActionDescriptorForViewTitle = (viewId: string, providerId: string): Readonly<IAction2Options> & { viewId: string } => ({
291291
viewId,
292-
id: `workbench.action.interactiveSession.${providerId}.history`,
292+
id: `workbench.action.chat.${providerId}.history`,
293293
title: {
294294
value: localize('interactiveSession.history.label', "Show History"),
295295
original: 'Show History'
@@ -312,17 +312,17 @@ export function getHistoryAction(viewId: string, providerId: string) {
312312
}
313313

314314
async runInView(accessor: ServicesAccessor, view: ChatViewPane) {
315-
const interactiveSessionService = accessor.get(IChatService);
315+
const chatService = accessor.get(IChatService);
316316
const quickInputService = accessor.get(IQuickInputService);
317317
const editorService = accessor.get(IEditorService);
318-
const items = interactiveSessionService.getHistory();
319-
const picks = items.map(i => (<IQuickPickItem & { interactiveSession: IChatDetail }>{
318+
const items = chatService.getHistory();
319+
const picks = items.map(i => (<IQuickPickItem & { chat: IChatDetail }>{
320320
label: i.title,
321-
interactiveSession: i
321+
chat: i
322322
}));
323323
const selection = await quickInputService.pick(picks, { placeHolder: localize('interactiveSession.history.pick', "Select a chat session to restore") });
324324
if (selection) {
325-
const sessionId = selection.interactiveSession.sessionId;
325+
const sessionId = selection.chat.sessionId;
326326
await editorService.openEditor({
327327
resource: ChatEditorInput.getNewEditorUri(), options: <IChatEditorOptions>{ target: { sessionId }, pinned: true }
328328
});

src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function registerChatCodeBlockActions() {
4646
registerAction2(class CopyCodeBlockAction extends Action2 {
4747
constructor() {
4848
super({
49-
id: 'workbench.action.interactiveSession.copyCodeBlock',
49+
id: 'workbench.action.chat.copyCodeBlock',
5050
title: {
5151
value: localize('interactive.copyCodeBlock.label', "Copy"),
5252
original: 'Copy'
@@ -70,8 +70,8 @@ export function registerChatCodeBlockActions() {
7070
const clipboardService = accessor.get(IClipboardService);
7171
clipboardService.writeText(context.code);
7272

73-
const interactiveSessionService = accessor.get(IChatService);
74-
interactiveSessionService.notifyUserAction(<IChatUserActionEvent>{
73+
const chatService = accessor.get(IChatService);
74+
chatService.notifyUserAction(<IChatUserActionEvent>{
7575
providerId: context.element.providerId,
7676
action: <IChatCopyAction>{
7777
kind: 'copy',
@@ -86,7 +86,7 @@ export function registerChatCodeBlockActions() {
8686
}
8787
});
8888

89-
CopyAction?.addImplementation(50000, 'interactiveSession-codeblock', (accessor) => {
89+
CopyAction?.addImplementation(50000, 'chat-codeblock', (accessor) => {
9090
// get active code editor
9191
const editor = accessor.get(ICodeEditorService).getFocusedCodeEditor();
9292
if (!editor) {
@@ -138,7 +138,7 @@ export function registerChatCodeBlockActions() {
138138
registerAction2(class InsertCodeBlockAction extends EditorAction2 {
139139
constructor() {
140140
super({
141-
id: 'workbench.action.interactiveSession.insertCodeBlock',
141+
id: 'workbench.action.chat.insertCodeBlock',
142142
title: {
143143
value: localize('interactive.insertCodeBlock.label', "Insert at Cursor"),
144144
original: 'Insert at Cursor'
@@ -246,7 +246,7 @@ export function registerChatCodeBlockActions() {
246246
registerAction2(class InsertIntoNewFileAction extends EditorAction2 {
247247
constructor() {
248248
super({
249-
id: 'workbench.action.interactiveSession.insertIntoNewFile',
249+
id: 'workbench.action.chat.insertIntoNewFile',
250250
title: {
251251
value: localize('interactive.insertIntoNewFile.label', "Insert Into New File"),
252252
original: 'Insert Into New File'
@@ -291,7 +291,7 @@ export function registerChatCodeBlockActions() {
291291
registerAction2(class RunInTerminalAction extends EditorAction2 {
292292
constructor() {
293293
super({
294-
id: 'workbench.action.interactiveSession.runInTerminal',
294+
id: 'workbench.action.chat.runInTerminal',
295295
title: {
296296
value: localize('interactive.runInTerminal.label', "Run in Terminal"),
297297
original: 'Run in Terminal'
@@ -389,7 +389,7 @@ export function registerChatCodeBlockActions() {
389389
registerAction2(class NextCodeBlockAction extends Action2 {
390390
constructor() {
391391
super({
392-
id: 'workbench.action.interactiveSession.nextCodeBlock',
392+
id: 'workbench.action.chat.nextCodeBlock',
393393
title: {
394394
value: localize('interactive.nextCodeBlock.label', "Next Code Block"),
395395
original: 'Next Code Block'
@@ -412,7 +412,7 @@ export function registerChatCodeBlockActions() {
412412
registerAction2(class PreviousCodeBlockAction extends Action2 {
413413
constructor() {
414414
super({
415-
id: 'workbench.action.interactiveSession.previousCodeBlock',
415+
id: 'workbench.action.chat.previousCodeBlock',
416416
title: {
417417
value: localize('interactive.previousCodeBlock.label', "Previous Code Block"),
418418
original: 'Previous Code Block'

src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function registerChatCopyActions() {
1515
registerAction2(class CopyAllAction extends Action2 {
1616
constructor() {
1717
super({
18-
id: 'workbench.action.interactiveSession.copyAll',
18+
id: 'workbench.action.chat.copyAll',
1919
title: {
2020
value: localize('interactive.copyAll.label', "Copy All"),
2121
original: 'Copy All'
@@ -48,7 +48,7 @@ export function registerChatCopyActions() {
4848
registerAction2(class CopyItemAction extends Action2 {
4949
constructor() {
5050
super({
51-
id: 'workbench.action.interactiveSession.copyItem',
51+
id: 'workbench.action.chat.copyItem',
5252
title: {
5353
value: localize('interactive.copyItem.label', "Copy"),
5454
original: 'Copy'

0 commit comments

Comments
 (0)