mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 01:29:04 +01:00
This commit is contained in:
@@ -12,7 +12,7 @@ import { EmbeddedCodeEditorWidget } from '../../../../editor/browser/widget/code
|
||||
import { EditorContextKeys } from '../../../../editor/common/editorContextKeys.js';
|
||||
import { InlineChatController, InlineChatController1, InlineChatController2, InlineChatRunOptions } from './inlineChatController.js';
|
||||
import { ACTION_ACCEPT_CHANGES, CTX_INLINE_CHAT_HAS_STASHED_SESSION, CTX_INLINE_CHAT_FOCUSED, CTX_INLINE_CHAT_INNER_CURSOR_FIRST, CTX_INLINE_CHAT_INNER_CURSOR_LAST, CTX_INLINE_CHAT_VISIBLE, CTX_INLINE_CHAT_OUTER_CURSOR_POSITION, MENU_INLINE_CHAT_WIDGET_STATUS, CTX_INLINE_CHAT_REQUEST_IN_PROGRESS, CTX_INLINE_CHAT_RESPONSE_TYPE, InlineChatResponseType, ACTION_REGENERATE_RESPONSE, ACTION_VIEW_IN_CHAT, ACTION_TOGGLE_DIFF, CTX_INLINE_CHAT_CHANGE_HAS_DIFF, CTX_INLINE_CHAT_CHANGE_SHOWS_DIFF, MENU_INLINE_CHAT_ZONE, ACTION_DISCARD_CHANGES, CTX_INLINE_CHAT_POSSIBLE, ACTION_START, MENU_INLINE_CHAT_SIDE, CTX_INLINE_CHAT_V2_ENABLED, CTX_INLINE_CHAT_V1_ENABLED } from '../common/inlineChat.js';
|
||||
import { ctxHasEditorModification, ctxHasRequestInProgress, ctxRequestCount } from '../../chat/browser/chatEditing/chatEditingEditorContextKeys.js';
|
||||
import { ctxHasEditorModification, ctxHasRequestInProgress } from '../../chat/browser/chatEditing/chatEditingEditorContextKeys.js';
|
||||
import { localize, localize2 } from '../../../../nls.js';
|
||||
import { Action2, IAction2Options, MenuId } from '../../../../platform/actions/common/actions.js';
|
||||
import { ContextKeyExpr, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
|
||||
@@ -694,10 +694,6 @@ export class UndoAndCloseSessionAction2 extends KeepOrUndoSessionAction {
|
||||
),
|
||||
weight: KeybindingWeight.WorkbenchContrib + 1,
|
||||
primary: KeyCode.Escape,
|
||||
}, {
|
||||
when: ContextKeyExpr.and(ctxRequestCount.isEqualTo(0), ChatContextKeys.inputHasText),
|
||||
weight: KeybindingWeight.WorkbenchContrib,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KeyI,
|
||||
}],
|
||||
menu: [{
|
||||
id: MenuId.ChatEditorInlineExecute,
|
||||
|
||||
@@ -1465,11 +1465,6 @@ export class InlineChatController2 implements IEditorContribution {
|
||||
this._store.dispose();
|
||||
}
|
||||
|
||||
toggleWidgetUntilNextRequest() {
|
||||
const value = this._showWidgetOverrideObs.get();
|
||||
this._showWidgetOverrideObs.set(!value, undefined);
|
||||
}
|
||||
|
||||
getWidgetPosition(): Position | undefined {
|
||||
return this._zone.rawValue?.position;
|
||||
}
|
||||
@@ -1485,11 +1480,18 @@ export class InlineChatController2 implements IEditorContribution {
|
||||
async run(arg?: InlineChatRunOptions): Promise<boolean> {
|
||||
assertType(this._editor.hasModel());
|
||||
|
||||
this.markActiveController();
|
||||
|
||||
const uri = this._editor.getModel().uri;
|
||||
const session = this._inlineChatSessions.getSession2(uri)
|
||||
?? await this._inlineChatSessions.createSession2(this._editor, uri, CancellationToken.None);
|
||||
|
||||
const existingSession = this._inlineChatSessions.getSession2(uri);
|
||||
if (existingSession) {
|
||||
await existingSession.editingSession.accept();
|
||||
existingSession.dispose();
|
||||
}
|
||||
|
||||
this.markActiveController();
|
||||
|
||||
const session = await this._inlineChatSessions.createSession2(this._editor, uri, CancellationToken.None);
|
||||
|
||||
// ADD diagnostics
|
||||
const entries: IChatRequestVariableEntry[] = [];
|
||||
|
||||
Reference in New Issue
Block a user