Skip to content

Commit d1132eb

Browse files
committed
Rename more variables/props
1 parent bb3607c commit d1132eb

File tree

13 files changed

+72
-72
lines changed

13 files changed

+72
-72
lines changed

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ export function registerChatCodeBlockActions() {
111111

112112
// Report copy to extensions
113113
if (context.element.providerResponseId) {
114-
const interactiveSessionService = accessor.get(IChatService);
115-
interactiveSessionService.notifyUserAction({
114+
const chatService = accessor.get(IChatService);
115+
chatService.notifyUserAction({
116116
providerId: context.element.providerId,
117117
action: {
118118
kind: 'copy',
@@ -229,8 +229,8 @@ export function registerChatCodeBlockActions() {
229229
}
230230

231231
private notifyUserAction(accessor: ServicesAccessor, context: IChatCodeBlockActionContext) {
232-
const interactiveSessionService = accessor.get(IChatService);
233-
interactiveSessionService.notifyUserAction(<IChatUserActionEvent>{
232+
const chatService = accessor.get(IChatService);
233+
chatService.notifyUserAction(<IChatUserActionEvent>{
234234
providerId: context.element.providerId,
235235
action: {
236236
kind: 'insert',
@@ -272,10 +272,10 @@ export function registerChatCodeBlockActions() {
272272
}
273273

274274
const editorService = accessor.get(IEditorService);
275-
const interactiveSessionService = accessor.get(IChatService);
275+
const chatService = accessor.get(IChatService);
276276
editorService.openEditor(<IUntitledTextResourceEditorInput>{ contents: context.code, languageId: context.languageId, resource: undefined });
277277

278-
interactiveSessionService.notifyUserAction(<IChatUserActionEvent>{
278+
chatService.notifyUserAction(<IChatUserActionEvent>{
279279
providerId: context.element.providerId,
280280
action: {
281281
kind: 'insert',
@@ -323,7 +323,7 @@ export function registerChatCodeBlockActions() {
323323
}
324324
}
325325

326-
const interactiveSessionService = accessor.get(IChatService);
326+
const chatService = accessor.get(IChatService);
327327
const terminalService = accessor.get(ITerminalService);
328328
const editorService = accessor.get(IEditorService);
329329
const terminalEditorService = accessor.get(ITerminalEditorService);
@@ -347,7 +347,7 @@ export function registerChatCodeBlockActions() {
347347

348348
terminal.sendText(context.code, false, true);
349349

350-
interactiveSessionService.notifyUserAction(<IChatUserActionEvent>{
350+
chatService.notifyUserAction(<IChatUserActionEvent>{
351351
providerId: context.element.providerId,
352352
action: {
353353
kind: 'runInTerminal',
@@ -361,8 +361,8 @@ export function registerChatCodeBlockActions() {
361361

362362
function navigateCodeBlocks(accessor: ServicesAccessor, reverse?: boolean): void {
363363
const codeEditorService = accessor.get(ICodeEditorService);
364-
const interactiveSessionWidgetService = accessor.get(IChatWidgetService);
365-
const widget = interactiveSessionWidgetService.lastFocusedWidget;
364+
const chatWidgetService = accessor.get(IChatWidgetService);
365+
const widget = chatWidgetService.lastFocusedWidget;
366366
if (!widget) {
367367
return;
368368
}
@@ -434,13 +434,13 @@ export function registerChatCodeBlockActions() {
434434
}
435435

436436
function getContextFromEditor(editor: ICodeEditor, accessor: ServicesAccessor): IChatCodeBlockActionContext | undefined {
437-
const interactiveSessionWidgetService = accessor.get(IChatWidgetService);
437+
const chatWidgetService = accessor.get(IChatWidgetService);
438438
const model = editor.getModel();
439439
if (!model) {
440440
return;
441441
}
442442

443-
const widget = interactiveSessionWidgetService.lastFocusedWidget;
443+
const widget = chatWidgetService.lastFocusedWidget;
444444
if (!widget) {
445445
return;
446446
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ export function registerChatExecuteActions() {
7676
return;
7777
}
7878

79-
const interactiveSessionService = accessor.get(IChatService);
79+
const chatService = accessor.get(IChatService);
8080
if (context.widget.viewModel) {
81-
interactiveSessionService.cancelCurrentRequestForSession(context.widget.viewModel.sessionId);
81+
chatService.cancelCurrentRequestForSession(context.widget.viewModel.sessionId);
8282
}
8383
}
8484
});

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class AskQuickQuestionAction extends Action2 {
5353

5454
run(accessor: ServicesAccessor, query: string): void {
5555
const quickInputService = accessor.get(IQuickInputService);
56-
const interactiveSessionService = accessor.get(IChatService);
56+
const chatService = accessor.get(IChatService);
5757
const instantiationService = accessor.get(IInstantiationService);
5858

5959
// First things first, clear the existing timer that will dispose the session
@@ -67,7 +67,7 @@ class AskQuickQuestionAction extends Action2 {
6767
}
6868

6969
// Check if any providers are available. If not, show nothing
70-
const providerInfo = interactiveSessionService.getProviderInfos()[0];
70+
const providerInfo = chatService.getProviderInfos()[0];
7171
if (!providerInfo) {
7272
return;
7373
}
@@ -169,13 +169,13 @@ class InteractiveQuickPickSession extends Disposable {
169169

170170
constructor(
171171
@IInstantiationService private readonly _instantiationService: IInstantiationService,
172-
@IChatService private readonly _interactiveSessionService: IChatService,
173-
@IChatWidgetService private readonly _interactiveSessionWidgetService: IChatWidgetService
172+
@IChatService private readonly _chatService: IChatService,
173+
@IChatWidgetService private readonly _chatWidgetService: IChatWidgetService
174174
) {
175175
super();
176176

177-
const providerInfo = _interactiveSessionService.getProviderInfos()[0];
178-
this._model = this._register(_interactiveSessionService.startSession(providerInfo.id, CancellationToken.None)!);
177+
const providerInfo = _chatService.getProviderInfos()[0];
178+
this._model = this._register(_chatService.startSession(providerInfo.id, CancellationToken.None)!);
179179
this._viewModel = this._register(new ChatViewModel(this._model, _instantiationService));
180180
}
181181

@@ -252,11 +252,11 @@ class InteractiveQuickPickSession extends Disposable {
252252
const lastRequest = requests[requests.length - 1];
253253
this._model.cancelRequest(lastRequest);
254254
}
255-
await this._interactiveSessionService.sendRequest(this.sessionId, query);
255+
await this._chatService.sendRequest(this.sessionId, query);
256256
}
257257

258258
async openInChat(value: string) {
259-
const widget = await this._interactiveSessionWidgetService.revealViewForProvider(this.providerId);
259+
const widget = await this._chatWidgetService.revealViewForProvider(this.providerId);
260260
if (!widget?.viewModel) {
261261
return;
262262
}
@@ -265,9 +265,9 @@ class InteractiveQuickPickSession extends Disposable {
265265
const response = requests.find(r => r.response?.response.value !== undefined);
266266
const message = response?.response?.response.value;
267267
if (message) {
268-
this._interactiveSessionService.addCompleteRequest(widget.viewModel.sessionId, value, { message });
268+
this._chatService.addCompleteRequest(widget.viewModel.sessionId, value, { message });
269269
} else if (value) {
270-
this._interactiveSessionService.sendRequest(widget.viewModel.sessionId, value);
270+
this._chatService.sendRequest(widget.viewModel.sessionId, value);
271271
}
272272
widget.focusInput();
273273
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ export function registerChatTitleActions() {
4646
return;
4747
}
4848

49-
const interactiveSessionService = accessor.get(IChatService);
50-
interactiveSessionService.notifyUserAction(<IChatUserActionEvent>{
49+
const chatService = accessor.get(IChatService);
50+
chatService.notifyUserAction(<IChatUserActionEvent>{
5151
providerId: item.providerId,
5252
action: {
5353
kind: 'vote',
@@ -85,8 +85,8 @@ export function registerChatTitleActions() {
8585
return;
8686
}
8787

88-
const interactiveSessionService = accessor.get(IChatService);
89-
interactiveSessionService.notifyUserAction(<IChatUserActionEvent>{
88+
const chatService = accessor.get(IChatService);
89+
chatService.notifyUserAction(<IChatUserActionEvent>{
9090
providerId: item.providerId,
9191
action: {
9292
kind: 'vote',

src/vs/workbench/contrib/chat/browser/chatEditor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ export class ChatEditor extends EditorPane {
4343
@IInstantiationService private readonly instantiationService: IInstantiationService,
4444
@IStorageService private readonly storageService: IStorageService,
4545
@IContextKeyService private readonly contextKeyService: IContextKeyService,
46-
@IChatService private readonly interactiveSessionService: IChatService,
46+
@IChatService private readonly chatService: IChatService,
4747
) {
4848
super(ChatEditorInput.EditorID, telemetryService, themeService, storageService);
4949
}
5050

5151
public async clear() {
5252
if (this.widget?.viewModel) {
53-
this.interactiveSessionService.clearSession(this.widget.viewModel.sessionId);
53+
this.chatService.clearSession(this.widget.viewModel.sessionId);
5454
}
5555
}
5656

src/vs/workbench/contrib/chat/browser/chatEditorInput.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class ChatEditorInput extends EditorInput {
3434
constructor(
3535
readonly resource: URI,
3636
readonly options: IChatEditorOptions,
37-
@IChatService private readonly interactiveSessionService: IChatService
37+
@IChatService private readonly chatService: IChatService
3838
) {
3939
super();
4040

@@ -70,8 +70,8 @@ export class ChatEditorInput extends EditorInput {
7070

7171
override async resolve(): Promise<ChatEditorModel | null> {
7272
const model = typeof this.sessionId === 'string' ?
73-
this.interactiveSessionService.getOrRestoreSession(this.sessionId) :
74-
this.interactiveSessionService.startSession(this.providerId!, CancellationToken.None);
73+
this.chatService.getOrRestoreSession(this.sessionId) :
74+
this.chatService.startSession(this.providerId!, CancellationToken.None);
7575

7676
if (!model) {
7777
return null;
@@ -85,7 +85,7 @@ export class ChatEditorInput extends EditorInput {
8585
override dispose(): void {
8686
super.dispose();
8787
if (this.sessionId) {
88-
this.interactiveSessionService.clearSession(this.sessionId);
88+
this.chatService.clearSession(this.sessionId);
8989
}
9090
}
9191
}

src/vs/workbench/contrib/chat/browser/chatListRenderer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class InteractiveListItemRenderer extends Disposable implements ITreeRend
114114
@ILogService private readonly logService: ILogService,
115115
@ICommandService private readonly commandService: ICommandService,
116116
@IContextKeyService private readonly contextKeyService: IContextKeyService,
117-
@IChatService private readonly interactiveSessionService: IChatService,
117+
@IChatService private readonly chatService: IChatService,
118118
) {
119119
super();
120120
this.renderer = this.instantiationService.createInstance(MarkdownRenderer, {});
@@ -292,7 +292,7 @@ export class InteractiveListItemRenderer extends Disposable implements ITreeRend
292292
element.commandFollowups,
293293
defaultButtonStyles,
294294
followup => {
295-
this.interactiveSessionService.notifyUserAction({
295+
this.chatService.notifyUserAction({
296296
providerId: element.providerId,
297297
action: {
298298
kind: 'command',

src/vs/workbench/contrib/chat/browser/chatOptions.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ export class ChatEditorOptions extends Disposable {
6060
}
6161

6262
private static readonly relevantSettingIds = [
63-
'interactiveSession.editor.lineHeight',
64-
'interactiveSession.editor.fontSize',
65-
'interactiveSession.editor.fontFamily',
66-
'interactiveSession.editor.fontWeight',
67-
'interactiveSession.editor.wordWrap',
63+
'chat.editor.lineHeight',
64+
'chat.editor.fontSize',
65+
'chat.editor.fontFamily',
66+
'chat.editor.fontWeight',
67+
'chat.editor.wordWrap',
6868
'editor.cursorBlinking',
6969
'editor.fontLigatures',
7070
'editor.accessibilitySupport',
@@ -101,7 +101,7 @@ export class ChatEditorOptions extends Disposable {
101101
const editorConfig = this.configurationService.getValue<IEditorOptions>('editor');
102102

103103
// TODO shouldn't the setting keys be more specific?
104-
const interactiveSessionEditorConfig = this.configurationService.getValue<IChatConfiguration>('interactiveSession').editor;
104+
const chatEditorConfig = this.configurationService.getValue<IChatConfiguration>('chat')?.editor;
105105
const accessibilitySupport = this.configurationService.getValue<'auto' | 'off' | 'on'>('editor.accessibilitySupport');
106106
this._config = {
107107
foreground: this.themeService.getColorTheme().getColor(this.foreground),
@@ -111,15 +111,15 @@ export class ChatEditorOptions extends Disposable {
111111
},
112112
resultEditor: {
113113
backgroundColor: this.themeService.getColorTheme().getColor(this.resultEditorBackgroundColor),
114-
fontSize: interactiveSessionEditorConfig.fontSize,
115-
fontFamily: interactiveSessionEditorConfig.fontFamily === 'default' ? editorConfig.fontFamily : interactiveSessionEditorConfig.fontFamily,
116-
fontWeight: interactiveSessionEditorConfig.fontWeight,
117-
lineHeight: interactiveSessionEditorConfig.lineHeight ? interactiveSessionEditorConfig.lineHeight : ChatEditorOptions.lineHeightEm * interactiveSessionEditorConfig.fontSize,
114+
fontSize: chatEditorConfig.fontSize,
115+
fontFamily: chatEditorConfig.fontFamily === 'default' ? editorConfig.fontFamily : chatEditorConfig.fontFamily,
116+
fontWeight: chatEditorConfig.fontWeight,
117+
lineHeight: chatEditorConfig.lineHeight ? chatEditorConfig.lineHeight : ChatEditorOptions.lineHeightEm * chatEditorConfig.fontSize,
118118
bracketPairColorization: {
119119
enabled: this.configurationService.getValue<boolean>('editor.bracketPairColorization.enabled'),
120120
independentColorPoolPerBracketType: this.configurationService.getValue<boolean>('editor.bracketPairColorization.independentColorPoolPerBracketType'),
121121
},
122-
wordWrap: interactiveSessionEditorConfig.wordWrap,
122+
wordWrap: chatEditorConfig.wordWrap,
123123
fontLigatures: editorConfig.fontLigatures,
124124
}
125125

src/vs/workbench/contrib/chat/browser/chatViewPane.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class ChatViewPane extends ViewPane implements IChatViewPane {
5757
@IThemeService themeService: IThemeService,
5858
@ITelemetryService telemetryService: ITelemetryService,
5959
@IStorageService private readonly storageService: IStorageService,
60-
@IChatService private readonly interactiveSessionService: IChatService,
60+
@IChatService private readonly chatService: IChatService,
6161
) {
6262
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
6363

@@ -69,7 +69,7 @@ export class ChatViewPane extends ViewPane implements IChatViewPane {
6969
private updateModel(model?: IChatModel | undefined): void {
7070
this.modelDisposables.clear();
7171

72-
model = model ?? this.interactiveSessionService.startSession(this.interactiveSessionViewOptions.providerId, CancellationToken.None);
72+
model = model ?? this.chatService.startSession(this.interactiveSessionViewOptions.providerId, CancellationToken.None);
7373
if (!model) {
7474
throw new Error('Could not start interactive session');
7575
}
@@ -97,7 +97,7 @@ export class ChatViewPane extends ViewPane implements IChatViewPane {
9797
}));
9898
this._widget.render(parent);
9999

100-
const initialModel = this.viewState.sessionId ? this.interactiveSessionService.getOrRestoreSession(this.viewState.sessionId) : undefined;
100+
const initialModel = this.viewState.sessionId ? this.chatService.getOrRestoreSession(this.viewState.sessionId) : undefined;
101101
this.updateModel(initialModel);
102102
}
103103

@@ -107,7 +107,7 @@ export class ChatViewPane extends ViewPane implements IChatViewPane {
107107

108108
async clear(): Promise<void> {
109109
if (this.widget.viewModel) {
110-
this.interactiveSessionService.clearSession(this.widget.viewModel.sessionId);
110+
this.chatService.clearSession(this.widget.viewModel.sessionId);
111111
this.updateModel();
112112
}
113113
}

src/vs/workbench/contrib/chat/browser/chatWidget.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,15 @@ export class ChatWidget extends Disposable implements IChatWidget {
111111
private readonly styles: IChatWidgetStyles,
112112
@IContextKeyService private readonly contextKeyService: IContextKeyService,
113113
@IInstantiationService private readonly instantiationService: IInstantiationService,
114-
@IChatService private readonly interactiveSessionService: IChatService,
115-
@IChatWidgetService interactiveSessionWidgetService: IChatWidgetService,
114+
@IChatService private readonly chatService: IChatService,
115+
@IChatWidgetService chatWidgetService: IChatWidgetService,
116116
@IContextMenuService private readonly contextMenuService: IContextMenuService,
117117
) {
118118
super();
119119
CONTEXT_IN_INTERACTIVE_SESSION.bindTo(contextKeyService).set(true);
120120
this.requestInProgress = CONTEXT_INTERACTIVE_REQUEST_IN_PROGRESS.bindTo(contextKeyService);
121121

122-
this._register((interactiveSessionWidgetService as ChatWidgetService).register(this));
122+
this._register((chatWidgetService as ChatWidgetService).register(this));
123123
}
124124

125125
get providerId(): string {
@@ -222,7 +222,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
222222
}
223223

224224
if (!this.slashCommandsPromise) {
225-
this.slashCommandsPromise = this.interactiveSessionService.getSlashCommands(this.viewModel.sessionId, CancellationToken.None).then(commands => {
225+
this.slashCommandsPromise = this.chatService.getSlashCommands(this.viewModel.sessionId, CancellationToken.None).then(commands => {
226226
// If this becomes a repeated pattern, we should have a real internal slash command provider system
227227
const clearCommand: ISlashCommand = {
228228
command: 'clear',
@@ -374,7 +374,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
374374
}
375375

376376
const input = query ?? editorValue;
377-
const result = await this.interactiveSessionService.sendRequest(this.viewModel.sessionId, input);
377+
const result = await this.chatService.sendRequest(this.viewModel.sessionId, input);
378378
if (result) {
379379
revealLastElement(this.tree);
380380
this.inputPart.acceptInput(query);

0 commit comments

Comments
 (0)