@codingame/monaco-vscode-chat-service-override 15.0.2 → 16.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +11 -8
- package/package.json +29 -20
- package/vscode/src/vs/editor/common/diff/documentDiffProvider.d.ts +22 -0
- package/vscode/src/vs/editor/common/diff/documentDiffProvider.js +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +9 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +80 -55
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/chatAttachPromptAction.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/chatAttachPromptAction.js +17 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/{askToSelectPrompt.d.ts → askToSelectPrompt/askToSelectPrompt.d.ts} +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/askToSelectPrompt.js +79 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/constants.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/constants.js +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/attachPrompts.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/attachPrompts.js +53 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPlaceholderText.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPlaceholderText.js +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPromptPickItem.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPromptPickItem.js +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/handleButtonClick.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/handleButtonClick.js +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +163 -72
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +22 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +9 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTransfer.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTransfer.js +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +242 -74
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditing.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditing.js +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +688 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +355 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +71 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +395 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +98 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +216 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +97 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +831 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +7 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +32 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +110 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +985 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +69 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookDiff.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookDiff.js +67 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +147 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.js +284 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +578 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookFileSystemProvider.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookFileSystemProvider.js +122 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/helpers.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/helpers.js +320 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/notebookCellChanges.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/notebookCellChanges.js +50 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +22 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +166 -62
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +6 -104
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +704 -732
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.d.ts +10 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.js +329 -236
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatusItemService.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatusItemService.js +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +14 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/media/editorHoverWrapper.css +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +17 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +217 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditingEditorOverlay.css +114 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditorController.css +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatSetup.css +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatStatus.css +90 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/createPromptCommand.js +65 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptName.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptSourceFolder.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/errors.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/utils/createPromptFile.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/utils/createPromptFile.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/usePromptCommand.js +14 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +16 -8
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +175 -57
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.d.ts +66 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.js +313 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +4 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatTransferService.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatTransferService.js +30 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/constants.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/constants.js +6 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/textModelContentsProvider.d.ts +10 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/textModelContentsProvider.js +18 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptLinkDiagnosticsProvider.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptLinkDiagnosticsProvider.js +117 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptPathAutocompletion.js +3 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/textModelPromptParser.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +6 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +157 -65
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +39 -21
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +2 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +11 -10
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.js +47 -0
- package/vscode/src/vs/workbench/services/workspaces/common/workspaceUtils.d.ts +5 -0
- package/vscode/src/vs/workbench/services/workspaces/common/workspaceUtils.js +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt.js +0 -142
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.d.ts +0 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +0 -331
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.d.ts +0 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.js +0 -110
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/media/editorHoverWrapper.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditingEditorOverlay.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatStatus.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatViewSetup.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatEntitlementsService.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/chat/common/chatEntitlementsService.js +0 -13
- package/vscode/src/vs/workbench/contrib/chat/common/chatQuotasService.d.ts +0 -31
- package/vscode/src/vs/workbench/contrib/chat/common/chatQuotasService.js +0 -85
- package/vscode/src/vs/workbench/contrib/chat/common/tools/tools.d.ts +0 -11
- package/vscode/src/vs/workbench/contrib/chat/common/tools/tools.js +0 -22
package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ServicesAccessor } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorExtensions";
|
|
2
|
+
import { Action2, IAction2Options } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions";
|
|
3
|
+
import { IChatEditingSession, IModifiedFileEntry, IModifiedFileEntryEditorIntegration } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService";
|
|
4
|
+
declare abstract class ChatEditingEditorAction extends Action2 {
|
|
5
|
+
constructor(desc: Readonly<IAction2Options>);
|
|
6
|
+
run(accessor: ServicesAccessor, ...args: any[]): Promise<void>;
|
|
7
|
+
abstract runChatEditingCommand(accessor: ServicesAccessor, session: IChatEditingSession, entry: IModifiedFileEntry, integration: IModifiedFileEntryEditorIntegration, ...args: any[]): Promise<void> | void;
|
|
8
|
+
}
|
|
9
|
+
declare abstract class AcceptDiscardAction extends ChatEditingEditorAction {
|
|
10
|
+
readonly accept: boolean;
|
|
11
|
+
constructor(id: string, accept: boolean);
|
|
12
|
+
runChatEditingCommand(accessor: ServicesAccessor, session: IChatEditingSession, entry: IModifiedFileEntry, _integration: IModifiedFileEntryEditorIntegration): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare class AcceptAction extends AcceptDiscardAction {
|
|
15
|
+
static readonly ID = "chatEditor.action.accept";
|
|
16
|
+
constructor();
|
|
17
|
+
}
|
|
18
|
+
export declare class RejectAction extends AcceptDiscardAction {
|
|
19
|
+
static readonly ID = "chatEditor.action.reject";
|
|
20
|
+
constructor();
|
|
21
|
+
}
|
|
22
|
+
export declare class ReviewChangesAction extends ChatEditingEditorAction {
|
|
23
|
+
constructor();
|
|
24
|
+
runChatEditingCommand(_accessor: ServicesAccessor, _session: IChatEditingSession, entry: IModifiedFileEntry, _integration: IModifiedFileEntryEditorIntegration, ..._args: any[]): void;
|
|
25
|
+
}
|
|
26
|
+
export declare function registerChatEditorActions(): void;
|
|
27
|
+
export declare const navigationBearingFakeActionId = "chatEditor.navigation.bearings";
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
|
|
2
|
+
import { localize2, localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
3
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
4
|
+
import { Action2, MenuId, registerAction2, MenuRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
5
|
+
import { KeybindingWeight } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
6
|
+
import { KeyMod, KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
7
|
+
import { CHAT_CATEGORY } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
8
|
+
import { ctxReviewModeEnabled, ctxHasRequestInProgress, ctxHasEditorModification } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorContextKeys';
|
|
9
|
+
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
10
|
+
import { EditorContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/editorContextKeys';
|
|
11
|
+
import { ACTIVE_GROUP } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService';
|
|
12
|
+
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
13
|
+
import { WorkingSetEntryState, CHAT_EDITING_MULTI_DIFF_SOURCE_RESOLVER_SCHEME } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService';
|
|
14
|
+
import { IChatEditingService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService.service';
|
|
15
|
+
import { resolveCommandsContext } from '@codingame/monaco-vscode-fdf643f9-94dd-5510-b97a-408abf26ad92-common/vscode/vs/workbench/browser/parts/editor/editorCommandsContext';
|
|
16
|
+
import { IListService } from '@codingame/monaco-vscode-api/vscode/vs/platform/list/browser/listService.service';
|
|
17
|
+
import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
18
|
+
import { MultiDiffEditorInput } from '@codingame/monaco-vscode-1cc4ea0a-c5b6-54ed-bb60-078a99119b55-common/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput';
|
|
19
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
20
|
+
import { ActiveEditorContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contextkeys';
|
|
21
|
+
import { EditorResourceAccessor, SideBySideEditor, TEXT_DIFF_EDITOR_ID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
|
|
22
|
+
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
23
|
+
|
|
24
|
+
class ChatEditingEditorAction extends Action2 {
|
|
25
|
+
constructor(desc) {
|
|
26
|
+
super({
|
|
27
|
+
category: CHAT_CATEGORY,
|
|
28
|
+
...desc
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
async run(accessor, ...args) {
|
|
32
|
+
const instaService = accessor.get(IInstantiationService);
|
|
33
|
+
const chatEditingService = accessor.get(IChatEditingService);
|
|
34
|
+
const editorService = accessor.get(IEditorService);
|
|
35
|
+
const uri = EditorResourceAccessor.getOriginalUri(editorService.activeEditorPane?.input, { supportSideBySide: SideBySideEditor.PRIMARY });
|
|
36
|
+
if (!uri || !editorService.activeEditorPane) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const session = chatEditingService.editingSessionsObs.get()
|
|
40
|
+
.find(candidate => candidate.getEntry(uri));
|
|
41
|
+
if (!session) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const entry = session.getEntry(uri);
|
|
45
|
+
const ctrl = entry.getEditorIntegration(editorService.activeEditorPane);
|
|
46
|
+
return instaService.invokeFunction(this.runChatEditingCommand.bind(this), session, entry, ctrl, ...args);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
class NavigateAction extends ChatEditingEditorAction {
|
|
50
|
+
constructor(next) {
|
|
51
|
+
super({
|
|
52
|
+
id: next
|
|
53
|
+
? 'chatEditor.action.navigateNext'
|
|
54
|
+
: 'chatEditor.action.navigatePrevious',
|
|
55
|
+
title: next
|
|
56
|
+
? ( localize2(4654, 'Go to Next Chat Edit'))
|
|
57
|
+
: ( localize2(4655, 'Go to Previous Chat Edit')),
|
|
58
|
+
icon: next ? Codicon.arrowDown : Codicon.arrowUp,
|
|
59
|
+
precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, ( ctxHasRequestInProgress.negate()))),
|
|
60
|
+
keybinding: {
|
|
61
|
+
primary: next
|
|
62
|
+
? KeyMod.Alt | KeyCode.F5
|
|
63
|
+
: KeyMod.Alt | KeyMod.Shift | KeyCode.F5,
|
|
64
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
65
|
+
when: ( ContextKeyExpr.and(ctxHasEditorModification, EditorContextKeys.focus)),
|
|
66
|
+
},
|
|
67
|
+
f1: true,
|
|
68
|
+
menu: {
|
|
69
|
+
id: MenuId.ChatEditingEditorContent,
|
|
70
|
+
group: 'navigate',
|
|
71
|
+
order: !next ? 2 : 3,
|
|
72
|
+
when: ( ContextKeyExpr.and(ctxReviewModeEnabled, ( ctxHasRequestInProgress.negate())))
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
this.next = next;
|
|
76
|
+
}
|
|
77
|
+
async runChatEditingCommand(accessor, session, entry, ctrl) {
|
|
78
|
+
const instaService = accessor.get(IInstantiationService);
|
|
79
|
+
const done = this.next
|
|
80
|
+
? ctrl.next(false)
|
|
81
|
+
: ctrl.previous(false);
|
|
82
|
+
if (done) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const didOpenNext = await instaService.invokeFunction(openNextOrPreviousChange, session, entry, this.next);
|
|
86
|
+
if (didOpenNext) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
this.next
|
|
90
|
+
? ctrl.next(true)
|
|
91
|
+
: ctrl.previous(true);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
async function openNextOrPreviousChange(accessor, session, entry, next) {
|
|
95
|
+
const editorService = accessor.get(IEditorService);
|
|
96
|
+
const entries = session.entries.get();
|
|
97
|
+
let idx = entries.indexOf(entry);
|
|
98
|
+
let newEntry;
|
|
99
|
+
while (true) {
|
|
100
|
+
idx = (idx + (next ? 1 : -1) + entries.length) % entries.length;
|
|
101
|
+
newEntry = entries[idx];
|
|
102
|
+
if (newEntry.state.get() === WorkingSetEntryState.Modified) {
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
else if (newEntry === entry) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const pane = await editorService.openEditor({
|
|
110
|
+
resource: newEntry.modifiedURI,
|
|
111
|
+
options: {
|
|
112
|
+
revealIfOpened: false,
|
|
113
|
+
revealIfVisible: false,
|
|
114
|
+
}
|
|
115
|
+
}, ACTIVE_GROUP);
|
|
116
|
+
if (!pane) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
if (session.entries.get().includes(newEntry)) {
|
|
120
|
+
newEntry.getEditorIntegration(pane).reveal(next);
|
|
121
|
+
}
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
class AcceptDiscardAction extends ChatEditingEditorAction {
|
|
125
|
+
constructor(id, accept) {
|
|
126
|
+
super({
|
|
127
|
+
id,
|
|
128
|
+
title: accept
|
|
129
|
+
? ( localize2(4656, 'Keep Chat Edits'))
|
|
130
|
+
: ( localize2(4657, 'Undo Chat Edits')),
|
|
131
|
+
shortTitle: accept
|
|
132
|
+
? ( localize2(4658, 'Keep'))
|
|
133
|
+
: ( localize2(4659, 'Undo')),
|
|
134
|
+
tooltip: accept
|
|
135
|
+
? ( localize2(4660, 'Keep Chat Edits in this File'))
|
|
136
|
+
: ( localize2(4661, 'Undo Chat Edits in this File')),
|
|
137
|
+
precondition: ( ContextKeyExpr.and(ctxHasEditorModification, ( ctxHasRequestInProgress.negate()))),
|
|
138
|
+
icon: accept
|
|
139
|
+
? Codicon.check
|
|
140
|
+
: Codicon.discard,
|
|
141
|
+
f1: true,
|
|
142
|
+
keybinding: {
|
|
143
|
+
when: EditorContextKeys.focus,
|
|
144
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
145
|
+
primary: accept
|
|
146
|
+
? KeyMod.CtrlCmd | KeyCode.Enter
|
|
147
|
+
: KeyMod.CtrlCmd | KeyCode.Backspace
|
|
148
|
+
},
|
|
149
|
+
menu: {
|
|
150
|
+
id: MenuId.ChatEditingEditorContent,
|
|
151
|
+
group: 'a_resolve',
|
|
152
|
+
order: accept ? 0 : 1,
|
|
153
|
+
when: ( ContextKeyExpr.and(!accept ? ctxReviewModeEnabled : undefined, ( ctxHasRequestInProgress.negate())))
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
this.accept = accept;
|
|
157
|
+
}
|
|
158
|
+
async runChatEditingCommand(accessor, session, entry, _integration) {
|
|
159
|
+
const instaService = accessor.get(IInstantiationService);
|
|
160
|
+
if (this.accept) {
|
|
161
|
+
session.accept(entry.modifiedURI);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
session.reject(entry.modifiedURI);
|
|
165
|
+
}
|
|
166
|
+
await instaService.invokeFunction(openNextOrPreviousChange, session, entry, true);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
class AcceptAction extends AcceptDiscardAction {
|
|
170
|
+
static { this.ID = 'chatEditor.action.accept'; }
|
|
171
|
+
constructor() {
|
|
172
|
+
super(AcceptAction.ID, true);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
class RejectAction extends AcceptDiscardAction {
|
|
176
|
+
static { this.ID = 'chatEditor.action.reject'; }
|
|
177
|
+
constructor() {
|
|
178
|
+
super(RejectAction.ID, false);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
class AcceptRejectHunkAction extends ChatEditingEditorAction {
|
|
182
|
+
constructor(_accept) {
|
|
183
|
+
super({
|
|
184
|
+
id: _accept ? 'chatEditor.action.acceptHunk' : 'chatEditor.action.undoHunk',
|
|
185
|
+
title: _accept ? ( localize2(4662, 'Keep this Change')) : ( localize2(4663, 'Undo this Change')),
|
|
186
|
+
precondition: ( ContextKeyExpr.and(ctxHasEditorModification, ( ctxHasRequestInProgress.negate()))),
|
|
187
|
+
icon: _accept ? Codicon.check : Codicon.discard,
|
|
188
|
+
f1: true,
|
|
189
|
+
keybinding: {
|
|
190
|
+
when: EditorContextKeys.focus,
|
|
191
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
192
|
+
primary: _accept
|
|
193
|
+
? KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Enter
|
|
194
|
+
: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Backspace
|
|
195
|
+
},
|
|
196
|
+
menu: {
|
|
197
|
+
id: MenuId.ChatEditingEditorHunk,
|
|
198
|
+
order: 1
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
this._accept = _accept;
|
|
202
|
+
}
|
|
203
|
+
runChatEditingCommand(_accessor, _session, _entry, ctrl, ...args) {
|
|
204
|
+
if (this._accept) {
|
|
205
|
+
ctrl.acceptNearestChange(args[0]);
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
ctrl.rejectNearestChange(args[0]);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
class ToggleDiffAction extends ChatEditingEditorAction {
|
|
213
|
+
constructor() {
|
|
214
|
+
super({
|
|
215
|
+
id: 'chatEditor.action.toggleDiff',
|
|
216
|
+
title: ( localize2(4664, 'Toggle Diff Editor')),
|
|
217
|
+
category: CHAT_CATEGORY,
|
|
218
|
+
toggled: {
|
|
219
|
+
condition: ( ContextKeyExpr.or(EditorContextKeys.inDiffEditor, ( ActiveEditorContext.isEqualTo(TEXT_DIFF_EDITOR_ID)))),
|
|
220
|
+
icon: Codicon.goToFile,
|
|
221
|
+
},
|
|
222
|
+
precondition: ( ContextKeyExpr.and(ctxHasEditorModification, ( ctxHasRequestInProgress.negate()))),
|
|
223
|
+
icon: Codicon.diffSingle,
|
|
224
|
+
keybinding: {
|
|
225
|
+
when: EditorContextKeys.focus,
|
|
226
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
227
|
+
primary: KeyMod.Alt | KeyMod.Shift | KeyCode.F7,
|
|
228
|
+
},
|
|
229
|
+
menu: [{
|
|
230
|
+
id: MenuId.ChatEditingEditorHunk,
|
|
231
|
+
order: 10
|
|
232
|
+
}, {
|
|
233
|
+
id: MenuId.ChatEditingEditorContent,
|
|
234
|
+
group: 'a_resolve',
|
|
235
|
+
order: 2,
|
|
236
|
+
when: ( ContextKeyExpr.and(ctxReviewModeEnabled, ( ctxHasRequestInProgress.negate())))
|
|
237
|
+
}]
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
runChatEditingCommand(_accessor, _session, _entry, integration, ...args) {
|
|
241
|
+
integration.toggleDiff(args[0]);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
class ToggleAccessibleDiffViewAction extends ChatEditingEditorAction {
|
|
245
|
+
constructor() {
|
|
246
|
+
super({
|
|
247
|
+
id: 'chatEditor.action.showAccessibleDiffView',
|
|
248
|
+
title: ( localize2(4665, 'Show Accessible Diff View')),
|
|
249
|
+
f1: true,
|
|
250
|
+
precondition: ( ContextKeyExpr.and(ctxHasEditorModification, ( ctxHasRequestInProgress.negate()))),
|
|
251
|
+
keybinding: {
|
|
252
|
+
when: EditorContextKeys.focus,
|
|
253
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
254
|
+
primary: KeyCode.F7,
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
runChatEditingCommand(_accessor, _session, _entry, integration) {
|
|
259
|
+
integration.enableAccessibleDiffView();
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
class ReviewChangesAction extends ChatEditingEditorAction {
|
|
263
|
+
constructor() {
|
|
264
|
+
super({
|
|
265
|
+
id: 'chatEditor.action.reviewChanges',
|
|
266
|
+
title: ( localize2(4666, "Review")),
|
|
267
|
+
precondition: ( ContextKeyExpr.and(ctxHasEditorModification, ( ctxHasRequestInProgress.negate()))),
|
|
268
|
+
menu: [{
|
|
269
|
+
id: MenuId.ChatEditingEditorContent,
|
|
270
|
+
group: 'a_resolve',
|
|
271
|
+
order: 3,
|
|
272
|
+
when: ( ContextKeyExpr.and(( ctxReviewModeEnabled.negate()), ( ctxHasRequestInProgress.negate()))),
|
|
273
|
+
}]
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
runChatEditingCommand(_accessor, _session, entry, _integration, ..._args) {
|
|
277
|
+
entry.enableReviewModeUntilSettled();
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
class MultiDiffAcceptDiscardAction extends Action2 {
|
|
281
|
+
constructor(accept) {
|
|
282
|
+
super({
|
|
283
|
+
id: accept ? 'chatEditing.multidiff.acceptAllFiles' : 'chatEditing.multidiff.discardAllFiles',
|
|
284
|
+
title: accept ? ( localize(4667, 'Keep All Edits')) : ( localize(4668, 'Undo All Edits')),
|
|
285
|
+
icon: accept ? Codicon.check : Codicon.discard,
|
|
286
|
+
menu: {
|
|
287
|
+
when: ( ContextKeyExpr.equals('resourceScheme', CHAT_EDITING_MULTI_DIFF_SOURCE_RESOLVER_SCHEME)),
|
|
288
|
+
id: MenuId.EditorTitle,
|
|
289
|
+
order: accept ? 0 : 1,
|
|
290
|
+
group: 'navigation',
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
this.accept = accept;
|
|
294
|
+
}
|
|
295
|
+
async run(accessor, ...args) {
|
|
296
|
+
const chatEditingService = accessor.get(IChatEditingService);
|
|
297
|
+
const editorService = accessor.get(IEditorService);
|
|
298
|
+
const editorGroupsService = accessor.get(IEditorGroupsService);
|
|
299
|
+
const listService = accessor.get(IListService);
|
|
300
|
+
const resolvedContext = resolveCommandsContext(args, editorService, editorGroupsService, listService);
|
|
301
|
+
const groupContext = resolvedContext.groupedEditors[0];
|
|
302
|
+
if (!groupContext) {
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
const editor = groupContext.editors[0];
|
|
306
|
+
if (!(editor instanceof MultiDiffEditorInput) || !editor.resource) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
const session = chatEditingService.getEditingSession(editor.resource.authority);
|
|
310
|
+
if (this.accept) {
|
|
311
|
+
await session?.accept();
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
await session?.reject();
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
function registerChatEditorActions() {
|
|
319
|
+
registerAction2(class NextAction extends NavigateAction {
|
|
320
|
+
constructor() { super(true); }
|
|
321
|
+
});
|
|
322
|
+
registerAction2(class PrevAction extends NavigateAction {
|
|
323
|
+
constructor() { super(false); }
|
|
324
|
+
});
|
|
325
|
+
registerAction2(ReviewChangesAction);
|
|
326
|
+
registerAction2(AcceptAction);
|
|
327
|
+
registerAction2(RejectAction);
|
|
328
|
+
registerAction2(class AcceptHunkAction extends AcceptRejectHunkAction {
|
|
329
|
+
constructor() { super(true); }
|
|
330
|
+
});
|
|
331
|
+
registerAction2(class AcceptHunkAction extends AcceptRejectHunkAction {
|
|
332
|
+
constructor() { super(false); }
|
|
333
|
+
});
|
|
334
|
+
registerAction2(ToggleDiffAction);
|
|
335
|
+
registerAction2(ToggleAccessibleDiffViewAction);
|
|
336
|
+
registerAction2(class extends MultiDiffAcceptDiscardAction {
|
|
337
|
+
constructor() { super(true); }
|
|
338
|
+
});
|
|
339
|
+
registerAction2(class extends MultiDiffAcceptDiscardAction {
|
|
340
|
+
constructor() { super(false); }
|
|
341
|
+
});
|
|
342
|
+
MenuRegistry.appendMenuItem(MenuId.ChatEditingEditorContent, {
|
|
343
|
+
command: {
|
|
344
|
+
id: navigationBearingFakeActionId,
|
|
345
|
+
title: ( localize(4669, "Navigation Status")),
|
|
346
|
+
precondition: ( ContextKeyExpr.false()),
|
|
347
|
+
},
|
|
348
|
+
group: 'navigate',
|
|
349
|
+
order: -1,
|
|
350
|
+
when: ( ContextKeyExpr.and(ctxReviewModeEnabled, ( ctxHasRequestInProgress.negate()))),
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
const navigationBearingFakeActionId = 'chatEditor.navigation.bearings';
|
|
354
|
+
|
|
355
|
+
export { AcceptAction, RejectAction, ReviewChangesAction, navigationBearingFakeActionId, registerChatEditorActions };
|
package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import '../media/chatEditingEditorOverlay.css
|
|
3
|
+
import '../media/chatEditingEditorOverlay.css';
|
|
4
4
|
import { DisposableStore, MutableDisposable, toDisposable, DisposableMap, combinedDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
5
|
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
6
6
|
import { MenuWorkbenchToolBar, HiddenItemStrategy } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar';
|
|
@@ -15,7 +15,7 @@ import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/th
|
|
|
15
15
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
16
16
|
import { assertType } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
17
17
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
18
|
-
import { navigationBearingFakeActionId, AcceptAction, RejectAction } from '
|
|
18
|
+
import { navigationBearingFakeActionId, AcceptAction, RejectAction } from './chatEditingEditorActions.js';
|
|
19
19
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
20
20
|
import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
21
21
|
import { EditorGroupView } from '@codingame/monaco-vscode-ad89fae6-94f0-5ac2-a185-22dea4b68ee0-common/vscode/vs/workbench/browser/parts/editor/editorGroupView';
|
|
@@ -72,10 +72,10 @@ let ChatEditorOverlayWidget = class ChatEditorOverlayWidget {
|
|
|
72
72
|
const { changeCount, activeIdx } = that._navigationBearings.read(r);
|
|
73
73
|
if (changeCount > 0) {
|
|
74
74
|
const n = activeIdx === -1 ? '1' : `${activeIdx + 1}`;
|
|
75
|
-
this.label.innerText = ( localize(
|
|
75
|
+
this.label.innerText = ( localize(4675, "{0} of {1}", n, changeCount));
|
|
76
76
|
}
|
|
77
77
|
else {
|
|
78
|
-
this.label.innerText = ( localize(
|
|
78
|
+
this.label.innerText = ( localize(4676, "0 of 0"));
|
|
79
79
|
}
|
|
80
80
|
this.updateTooltip();
|
|
81
81
|
}));
|
|
@@ -86,16 +86,16 @@ let ChatEditorOverlayWidget = class ChatEditorOverlayWidget {
|
|
|
86
86
|
return undefined;
|
|
87
87
|
}
|
|
88
88
|
else if (changeCount === 1 && entriesCount === 1) {
|
|
89
|
-
return localize(
|
|
89
|
+
return localize(4677, "1 change in 1 file");
|
|
90
90
|
}
|
|
91
91
|
else if (changeCount === 1) {
|
|
92
|
-
return localize(
|
|
92
|
+
return localize(4678, "1 change in {0} files", entriesCount);
|
|
93
93
|
}
|
|
94
94
|
else if (entriesCount === 1) {
|
|
95
|
-
return localize(
|
|
95
|
+
return localize(4679, "{0} changes in 1 file", changeCount);
|
|
96
96
|
}
|
|
97
97
|
else {
|
|
98
|
-
return localize(
|
|
98
|
+
return localize(4680, "{0} changes in {1} files", changeCount, entriesCount);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
});
|
|
@@ -151,14 +151,14 @@ let ChatEditorOverlayWidget = class ChatEditorOverlayWidget {
|
|
|
151
151
|
const response = that._entry.read(r)?.isCurrentlyBeingModifiedBy.read(r);
|
|
152
152
|
if (response) {
|
|
153
153
|
if (response?.isPaused.read(r)) {
|
|
154
|
-
return { message: ( localize(
|
|
154
|
+
return { message: ( localize(4681, "Edits Paused")), paused: true };
|
|
155
155
|
}
|
|
156
156
|
const entry = that._entry.read(r);
|
|
157
157
|
if (entry) {
|
|
158
158
|
const progress = entry?.rewriteRatio.read(r);
|
|
159
159
|
const message = progress === 0
|
|
160
|
-
? ( localize(
|
|
161
|
-
: ( localize(
|
|
160
|
+
? ( localize(4682, "Generating edits"))
|
|
161
|
+
: ( localize(4683, "{0}% Applying edits", Math.round(progress * 100)));
|
|
162
162
|
return { message };
|
|
163
163
|
}
|
|
164
164
|
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { IReference } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { IObservable, ITransaction } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
|
|
3
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
4
|
+
import { TextEdit } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages";
|
|
5
|
+
import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service";
|
|
6
|
+
import { IEditorWorkerService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/editorWorker.service";
|
|
7
|
+
import { IModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service";
|
|
8
|
+
import { IResolvedTextEditorModel } from "@codingame/monaco-vscode-model-service-override/vscode/vs/editor/common/services/resolverService";
|
|
9
|
+
import { ITextModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service";
|
|
10
|
+
import { IAccessibilitySignalService } from "@codingame/monaco-vscode-api/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service";
|
|
11
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
12
|
+
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
13
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
14
|
+
import { IMarkerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/markers/common/markers.service";
|
|
15
|
+
import { IUndoRedoElement } from "@codingame/monaco-vscode-api/vscode/vs/platform/undoRedo/common/undoRedo";
|
|
16
|
+
import { IUndoRedoService } from "@codingame/monaco-vscode-api/vscode/vs/platform/undoRedo/common/undoRedo.service";
|
|
17
|
+
import { IEditorPane } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor";
|
|
18
|
+
import { IFilesConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.service";
|
|
19
|
+
import { IResolvedTextFileEditorModel } from "@codingame/monaco-vscode-aff8bc9b-c6f8-578f-9c8a-f70d14f9c13c-common/vscode/vs/workbench/services/textfile/common/textfiles";
|
|
20
|
+
import { ITextFileService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles.service";
|
|
21
|
+
import { ICellEditOperation } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
|
|
22
|
+
import { IModifiedFileEntry, ChatEditKind, IModifiedFileEntryEditorIntegration } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService";
|
|
23
|
+
import { IChatResponseModel } from "@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/common/chatModel";
|
|
24
|
+
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service";
|
|
25
|
+
import { AbstractChatEditingModifiedFileEntry, IModifiedEntryTelemetryInfo, ISnapshotEntry } from "./chatEditingModifiedFileEntry.js";
|
|
26
|
+
export declare class ChatEditingModifiedDocumentEntry extends AbstractChatEditingModifiedFileEntry implements IModifiedFileEntry {
|
|
27
|
+
private readonly _multiDiffEntryDelegate;
|
|
28
|
+
private readonly _editorWorkerService;
|
|
29
|
+
private readonly _textFileService;
|
|
30
|
+
private readonly _accessibilitySignalService;
|
|
31
|
+
private static readonly _lastEditDecorationOptions;
|
|
32
|
+
private static readonly _pendingEditDecorationOptions;
|
|
33
|
+
readonly initialContent: string;
|
|
34
|
+
private readonly originalModel;
|
|
35
|
+
private readonly modifiedModel;
|
|
36
|
+
readonly docFileEditorModel: IResolvedTextFileEditorModel;
|
|
37
|
+
private _edit;
|
|
38
|
+
private _isEditFromUs;
|
|
39
|
+
private _allEditsAreFromUs;
|
|
40
|
+
private _diffOperation;
|
|
41
|
+
private _diffOperationIds;
|
|
42
|
+
private readonly _diffInfo;
|
|
43
|
+
readonly changesCount: IObservable<number>;
|
|
44
|
+
private readonly _editDecorationClear;
|
|
45
|
+
private _editDecorations;
|
|
46
|
+
private readonly _diffTrimWhitespace;
|
|
47
|
+
readonly originalURI: URI;
|
|
48
|
+
constructor(resourceRef: IReference<IResolvedTextEditorModel>, _multiDiffEntryDelegate: {
|
|
49
|
+
collapse: (transaction: ITransaction | undefined) => void;
|
|
50
|
+
}, telemetryInfo: IModifiedEntryTelemetryInfo, kind: ChatEditKind, initialContent: string | undefined, markerService: IMarkerService, modelService: IModelService, textModelService: ITextModelService, languageService: ILanguageService, configService: IConfigurationService, fileConfigService: IFilesConfigurationService, chatService: IChatService, _editorWorkerService: IEditorWorkerService, _textFileService: ITextFileService, fileService: IFileService, undoRedoService: IUndoRedoService, instantiationService: IInstantiationService, _accessibilitySignalService: IAccessibilitySignalService);
|
|
51
|
+
private _clearCurrentEditLineDecoration;
|
|
52
|
+
equalsSnapshot(snapshot: ISnapshotEntry | undefined): boolean;
|
|
53
|
+
createSnapshot(requestId: string | undefined, undoStop: string | undefined): ISnapshotEntry;
|
|
54
|
+
restoreFromSnapshot(snapshot: ISnapshotEntry, restoreToDisk?: boolean): void;
|
|
55
|
+
resetToInitialContent(): void;
|
|
56
|
+
protected _areOriginalAndModifiedIdentical(): Promise<boolean>;
|
|
57
|
+
protected _resetEditsState(tx: ITransaction): void;
|
|
58
|
+
private _mirrorEdits;
|
|
59
|
+
protected _createUndoRedoElement(response: IChatResponseModel): IUndoRedoElement;
|
|
60
|
+
acceptAgentEdits(resource: URI, textEdits: (TextEdit | ICellEditOperation)[], isLastEdits: boolean, responseModel: IChatResponseModel): Promise<void>;
|
|
61
|
+
private _acceptHunk;
|
|
62
|
+
private _rejectHunk;
|
|
63
|
+
private _applyEdits;
|
|
64
|
+
private _updateDiffInfoSeq;
|
|
65
|
+
private _updateDiffInfo;
|
|
66
|
+
protected _doAccept(tx: ITransaction | undefined): Promise<void>;
|
|
67
|
+
protected _doReject(tx: ITransaction | undefined): Promise<void>;
|
|
68
|
+
private _setDocValue;
|
|
69
|
+
private _collapse;
|
|
70
|
+
protected _createEditorIntegration(editor: IEditorPane): IModifiedFileEntryEditorIntegration;
|
|
71
|
+
}
|