mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 10:08:49 +01:00
Cleanup and prepare inline chat for UI updates (#215420)
* 💄
* debt - remove `trackEdits` because we have fixup
debt - don't compute diff twice
* allow to pass/use all chat widget options when creating an inline chat widget
This commit is contained in:
@@ -16,7 +16,6 @@ import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/c
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ACTION_ACCEPT_CHANGES, ACTION_REGENERATE_RESPONSE, ACTION_TOGGLE_DIFF, CTX_INLINE_CHAT_OUTER_CURSOR_POSITION, EditMode, InlineChatConfigKeys, MENU_INLINE_CHAT_WIDGET, MENU_INLINE_CHAT_WIDGET_STATUS } from 'vs/workbench/contrib/inlineChat/common/inlineChat';
|
||||
import { EditorBasedInlineChatWidget } from './inlineChatWidget';
|
||||
import { MenuId } from 'vs/platform/actions/common/actions';
|
||||
import { isEqual } from 'vs/base/common/resources';
|
||||
import { StableEditorBottomScrollState } from 'vs/editor/browser/stableEditorScroll';
|
||||
import { ScrollType } from 'vs/editor/common/editorCommon';
|
||||
@@ -47,9 +46,6 @@ export class InlineChatZoneWidget extends ZoneWidget {
|
||||
}));
|
||||
|
||||
this.widget = this._instaService.createInstance(EditorBasedInlineChatWidget, location, this.editor, {
|
||||
telemetrySource: 'interactiveEditorWidget-toolbar',
|
||||
inputMenuId: MenuId.ChatExecute,
|
||||
widgetMenuId: MENU_INLINE_CHAT_WIDGET,
|
||||
statusMenuId: {
|
||||
menu: MENU_INLINE_CHAT_WIDGET_STATUS,
|
||||
options: {
|
||||
@@ -64,13 +60,19 @@ export class InlineChatZoneWidget extends ZoneWidget {
|
||||
}
|
||||
}
|
||||
},
|
||||
rendererOptions: {
|
||||
renderTextEditsAsSummary: (uri) => {
|
||||
// render edits as summary only when using Live mode and when
|
||||
// dealing with the current file in the editor
|
||||
return isEqual(uri, editor.getModel()?.uri)
|
||||
&& configurationService.getValue<EditMode>(InlineChatConfigKeys.Mode) === EditMode.Live;
|
||||
chatWidgetViewOptions: {
|
||||
menus: {
|
||||
inputSideToolbar: MENU_INLINE_CHAT_WIDGET,
|
||||
telemetrySource: 'interactiveEditorWidget-toolbar',
|
||||
},
|
||||
rendererOptions: {
|
||||
renderTextEditsAsSummary: (uri) => {
|
||||
// render edits as summary only when using Live mode and when
|
||||
// dealing with the current file in the editor
|
||||
return isEqual(uri, editor.getModel()?.uri)
|
||||
&& configurationService.getValue<EditMode>(InlineChatConfigKeys.Mode) === EditMode.Live;
|
||||
},
|
||||
}
|
||||
}
|
||||
});
|
||||
this._disposables.add(this.widget.onDidChangeHeight(() => {
|
||||
|
||||
Reference in New Issue
Block a user