@codingame/monaco-vscode-api 1.82.6 → 1.83.0-next.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/api.js +5 -5
- package/assets/index-no-csp.html +2 -1
- package/assets/index.html +3 -2
- package/extensions.js +17 -14
- package/external/xterm/typings/xterm.d.ts +171 -109
- package/missing-services.js +33 -22
- package/monaco-editor-treemending.patch +1745 -1628
- package/monaco-treemending.js +2 -2
- package/monaco.js +2 -2
- package/package.json +2 -2
- package/service-override/extensions.js +10 -11
- package/services.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/menu/menubar.js +1 -1
- package/vscode/src/vs/base/common/event.d.ts +13 -17
- package/vscode/src/vs/base/common/keyCodes.d.ts +18 -18
- package/vscode/src/vs/base/common/lifecycle.d.ts +9 -0
- package/vscode/src/vs/base/common/observableInternal/base.d.ts +2 -0
- package/vscode/src/vs/base/common/product.d.ts +1 -0
- package/vscode/src/vs/base/parts/ipc/common/ipc.js +6 -2
- package/vscode/src/vs/base/parts/storage/common/storage.d.ts +1 -0
- package/vscode/src/vs/editor/common/config/editorOptions.d.ts +12 -3
- package/vscode/src/vs/editor/common/core/lineRange.d.ts +0 -5
- package/vscode/src/vs/editor/common/core/offsetRange.d.ts +9 -2
- package/vscode/src/vs/editor/common/diff/documentDiffProvider.d.ts +6 -20
- package/vscode/src/vs/editor/common/diff/legacyLinesDiffComputer.d.ts +2 -2
- package/vscode/src/vs/editor/common/diff/linesDiffComputer.d.ts +5 -55
- package/vscode/src/vs/editor/common/diff/rangeMapping.d.ts +55 -0
- package/vscode/src/vs/editor/common/languages.d.ts +7 -10
- package/vscode/src/vs/editor/common/model.d.ts +1 -1
- package/vscode/src/vs/platform/actions/common/actions.d.ts +1 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionNls.js +5 -5
- package/vscode/src/vs/platform/files/common/fileService.js +46 -40
- package/vscode/src/vs/platform/files/common/files.d.ts +46 -1
- package/vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.js +45 -0
- package/vscode/src/vs/platform/storage/common/storage.d.ts +5 -0
- package/vscode/src/vs/platform/storage/common/storage.js +4 -0
- package/vscode/src/vs/platform/telemetry/common/telemetryUtils.js +4 -1
- package/vscode/src/vs/platform/terminal/common/terminal.js +1 -3
- package/vscode/src/vs/platform/tunnel/common/tunnel.d.ts +1 -1
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.d.ts +1 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +11 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents.js +50 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSlashCommands.js +3 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +16 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +20 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +8 -8
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +3 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +93 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +3 -166
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +3 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +18 -11
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +14 -9
- package/vscode/src/vs/workbench/api/common/extHost.protocol.js +2 -1
- package/vscode/src/vs/workbench/api/common/extHostApiCommands.js +11 -2
- package/vscode/src/vs/workbench/api/common/extHostChat.js +10 -1
- package/vscode/src/vs/workbench/api/common/extHostChatAgents.js +62 -0
- package/vscode/src/vs/workbench/api/common/extHostChatSlashCommand.js +13 -4
- package/vscode/src/vs/workbench/api/common/extHostCommands.js +4 -4
- package/vscode/src/vs/workbench/api/common/extHostComments.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +36 -4
- package/vscode/src/vs/workbench/api/common/extHostInlineChat.js +6 -29
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +24 -12
- package/vscode/src/vs/workbench/api/common/extHostNotebookKernels.js +0 -2
- package/vscode/src/vs/workbench/api/common/extHostRequireInterceptor.js +0 -63
- package/vscode/src/vs/workbench/api/common/extHostSCM.js +80 -0
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +24 -0
- package/vscode/src/vs/workbench/api/common/extHostTesting.js +14 -10
- package/vscode/src/vs/workbench/api/common/extHostTextEditor.js +4 -4
- package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +11 -7
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +34 -16
- package/vscode/src/vs/workbench/api/common/extHostTypes.js +31 -13
- package/vscode/src/vs/workbench/api/common/extHostWebview.js +14 -2
- package/vscode/src/vs/workbench/api/common/extHostWebviewPanels.js +11 -5
- package/vscode/src/vs/workbench/api/common/extensionHostMain.js +1 -1
- package/vscode/src/vs/workbench/browser/actions/layoutActions.js +32 -9
- package/vscode/src/vs/workbench/browser/actions/quickAccessActions.js +3 -1
- package/vscode/src/vs/workbench/browser/codeeditor.js +1 -1
- package/vscode/src/vs/workbench/browser/dnd.js +7 -6
- package/vscode/src/vs/workbench/browser/media/part.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +7 -10
- package/vscode/src/vs/workbench/browser/parts/editor/editor.js +7 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorActions.js +9 -3
- package/vscode/src/vs/workbench/browser/parts/editor/editorAutoSave.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +9 -2
- package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +44 -14
- package/vscode/src/vs/workbench/browser/parts/editor/media/editorplaceholder.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/textDiffEditor.js +3 -19
- package/vscode/src/vs/workbench/browser/parts/editor/textResourceEditor.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCommands.js +9 -3
- package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarPart.d.ts +1 -1
- package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.js +10 -9
- package/vscode/src/vs/workbench/browser/parts/views/viewFilter.js +2 -0
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +6 -5
- package/vscode/src/vs/workbench/browser/web.api.d.ts +0 -6
- package/vscode/src/vs/workbench/browser/workbench.contribution.js +34 -3
- package/vscode/src/vs/workbench/common/contextkeys.js +2 -1
- package/vscode/src/vs/workbench/common/editor/editorGroupModel.js +4 -4
- package/vscode/src/vs/workbench/common/editor/editorInput.d.ts +0 -1
- package/vscode/src/vs/workbench/common/editor/editorInput.js +2 -4
- package/vscode/src/vs/workbench/common/editor/editorModel.d.ts +0 -1
- package/vscode/src/vs/workbench/common/editor/editorModel.js +1 -3
- package/vscode/src/vs/workbench/common/editor.d.ts +2 -0
- package/vscode/src/vs/workbench/common/theme.js +21 -1
- package/vscode/src/vs/workbench/common/views.d.ts +1 -1
- package/vscode/src/vs/workbench/common/views.js +1 -2
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +12 -4
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityContributions.js +335 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleView.js +81 -27
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.js +1 -1
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkTextEdits.js +22 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.js +136 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +14 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +78 -1
- package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +43 -17
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +30 -26
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.js +23 -18
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +8 -8
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +55 -20
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +26 -10
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +7 -6
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +58 -9
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +9 -6
- package/vscode/src/vs/workbench/contrib/comments/browser/comments.contribution.js +171 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +204 -33
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +3 -7
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +2 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/simpleCommentEditor.js +21 -4
- package/vscode/src/vs/workbench/contrib/comments/common/commentContextKeys.js +22 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debug.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/debug/common/debugUtils.js +2 -1
- package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/fileImportExport.js +2 -2
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.js +7 -4
- package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +2 -1
- package/vscode/src/vs/workbench/contrib/files/common/files.js +7 -5
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +2 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +17 -17
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +4 -1
- package/vscode/src/vs/workbench/contrib/output/browser/output.contribution.js +22 -19
- package/vscode/src/vs/workbench/contrib/output/browser/outputServices.js +2 -38
- package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +14 -1
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +3 -8
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +10 -12
- package/vscode/src/vs/workbench/contrib/snippets/browser/tabCompletion.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalContextKey.js +0 -16
- package/vscode/src/vs/workbench/contrib/testing/common/observableValue.js +2 -1
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +8 -6
- package/vscode/src/vs/workbench/services/actions/common/menusExtensionPoint.js +2 -4
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +2 -4
- package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +7 -3
- package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.d.ts +2 -6
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +18 -20
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +9 -13
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +2 -1
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +47 -15
- package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.d.ts +14 -4
- package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.js +22 -3
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +15 -14
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostProtocol.d.ts +12 -7
- package/vscode/src/vs/workbench/services/extensions/common/extensions.d.ts +10 -6
- package/vscode/src/vs/workbench/services/extensions/common/extensions.js +27 -11
- package/vscode/src/vs/workbench/services/extensions/common/extensionsApiProposals.js +2 -5
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +7 -11
- package/vscode/src/vs/workbench/services/extensions/common/rpcProtocol.js +20 -4
- package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.js +24 -16
- package/vscode/src/vs/workbench/services/output/common/output.js +1 -2
- package/vscode/src/vs/workbench/services/preferences/common/preferences.d.ts +6 -6
- package/vscode/src/vs/workbench/services/preferences/common/preferences.js +4 -3
- package/vscode/src/vs/workbench/services/preferences/common/preferencesModels.d.ts +0 -1
- package/vscode/src/vs/workbench/services/search/common/fileSearchManager.js +3 -1
- package/vscode/src/vs/workbench/services/search/common/search.js +2 -1
- package/vscode/src/vs/workbench/services/search/common/textSearchManager.js +1 -2
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +2 -2
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileService.js +3 -8
- package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +3 -4
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant.js +1 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyBackupService.js +2 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyService.js +4 -2
- package/vscode/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.contribution.js +0 -180
- package/vscode/src/vs/platform/credentials/common/credentials.d.ts +0 -13
- package/vscode/src/vs/platform/credentials/common/credentials.js +0 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadKeytar.js +0 -31
- package/vscode/src/vs/workbench/browser/iframe.js +0 -16
- package/vscode/src/vs/workbench/browser/parts/editor/accessibilityStatus.js +0 -90
- package/vscode/src/vs/workbench/browser/parts/editor/tabFocus.js +0 -77
- package/vscode/src/vs/workbench/contrib/output/browser/logViewer.js +0 -67
|
@@ -187,7 +187,7 @@ let BulkEditService = class BulkEditService {
|
|
|
187
187
|
codeEditor = candidate.getModifiedEditor();
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
if (codeEditor && codeEditor.getOption(
|
|
190
|
+
if (codeEditor && codeEditor.getOption(90 )) {
|
|
191
191
|
codeEditor = undefined;
|
|
192
192
|
}
|
|
193
193
|
let undoRedoGroup;
|
|
@@ -165,7 +165,7 @@ let BulkTextEdits = class BulkTextEdits {
|
|
|
165
165
|
async _createEditsTasks() {
|
|
166
166
|
const tasks = [];
|
|
167
167
|
const promises = [];
|
|
168
|
-
for (const [key,
|
|
168
|
+
for (const [key, edits] of this._edits) {
|
|
169
169
|
const promise = this._textModelResolverService.createModelReference(key).then(async (ref) => {
|
|
170
170
|
let task;
|
|
171
171
|
let makeMinimal = false;
|
|
@@ -176,23 +176,31 @@ let BulkTextEdits = class BulkTextEdits {
|
|
|
176
176
|
else {
|
|
177
177
|
task = ( new ModelEditTask(ref));
|
|
178
178
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
179
|
+
tasks.push(task);
|
|
180
|
+
if (!makeMinimal) {
|
|
181
|
+
edits.forEach(task.addEdit, task);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const makeGroupMoreMinimal = async (start, end) => {
|
|
185
|
+
const oldEdits = edits.slice(start, end);
|
|
186
|
+
const newEdits = await this._editorWorker.computeMoreMinimalEdits(ref.object.textEditorModel.uri, ( oldEdits.map(e => e.textEdit)), false);
|
|
187
|
+
if (!newEdits) {
|
|
188
|
+
oldEdits.forEach(task.addEdit, task);
|
|
190
189
|
}
|
|
191
190
|
else {
|
|
192
|
-
task.addEdit(edit);
|
|
191
|
+
newEdits.forEach(edit => task.addEdit(( new ResourceTextEdit(ref.object.textEditorModel.uri, edit, undefined, undefined))));
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
let start = 0;
|
|
195
|
+
let i = 0;
|
|
196
|
+
for (; i < edits.length; i++) {
|
|
197
|
+
if (edits[i].textEdit.insertAsSnippet || edits[i].metadata) {
|
|
198
|
+
await makeGroupMoreMinimal(start, i);
|
|
199
|
+
task.addEdit(edits[i]);
|
|
200
|
+
start = i + 1;
|
|
193
201
|
}
|
|
194
202
|
}
|
|
195
|
-
|
|
203
|
+
await makeGroupMoreMinimal(start, i);
|
|
196
204
|
});
|
|
197
205
|
promises.push(promise);
|
|
198
206
|
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
3
|
+
import { Iterable } from 'monaco-editor/esm/vs/base/common/iterator.js';
|
|
4
|
+
import { Disposable, toDisposable, combinedDisposable, DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
5
|
+
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
6
|
+
import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
7
|
+
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
8
|
+
import { Extensions } from '../../../common/contributions.js';
|
|
9
|
+
import { isProposedApiEnabled } from '../../../services/extensions/common/extensions.js';
|
|
10
|
+
import { ExtensionsRegistry } from '../../../services/extensions/common/extensionsRegistry.js';
|
|
11
|
+
const agentItem = {
|
|
12
|
+
type: 'object',
|
|
13
|
+
required: ['agent', 'detail'],
|
|
14
|
+
properties: {
|
|
15
|
+
agent: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
markdownDescription: ( localize('agent', "The name of the agent which will be used as prefix."))
|
|
18
|
+
},
|
|
19
|
+
detail: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
markdownDescription: ( localize('details', "The details of the agent."))
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const agentItems = {
|
|
26
|
+
description: ( localize('vscode.extension.contributes.slashes', "Contributes agents to chat")),
|
|
27
|
+
oneOf: [
|
|
28
|
+
agentItem,
|
|
29
|
+
{
|
|
30
|
+
type: 'array',
|
|
31
|
+
items: agentItem
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
};
|
|
35
|
+
const agentsExtPoint = ( ExtensionsRegistry.registerExtensionPoint({
|
|
36
|
+
extensionPoint: 'agents',
|
|
37
|
+
jsonSchema: agentItems
|
|
38
|
+
}));
|
|
39
|
+
function isAgentData(data) {
|
|
40
|
+
return typeof data === 'object' && data &&
|
|
41
|
+
typeof data.id === 'string' &&
|
|
42
|
+
typeof data.detail === 'string';
|
|
43
|
+
}
|
|
44
|
+
const IChatAgentService = ( createDecorator('chatAgentService'));
|
|
45
|
+
(class ChatAgentService extends Disposable {
|
|
46
|
+
static { this.AGENT_LEADER = '@'; }
|
|
47
|
+
constructor(_extensionService) {
|
|
48
|
+
super();
|
|
49
|
+
this._extensionService = _extensionService;
|
|
50
|
+
this._agents = ( new Map());
|
|
51
|
+
this._onDidChangeAgents = this._register(( new Emitter()));
|
|
52
|
+
this.onDidChangeAgents = this._onDidChangeAgents.event;
|
|
53
|
+
}
|
|
54
|
+
dispose() {
|
|
55
|
+
super.dispose();
|
|
56
|
+
this._agents.clear();
|
|
57
|
+
}
|
|
58
|
+
registerAgentData(data) {
|
|
59
|
+
if (( this._agents.has(data.id))) {
|
|
60
|
+
throw new Error(`Already registered an agent with id ${data.id}}`);
|
|
61
|
+
}
|
|
62
|
+
this._agents.set(data.id, { data });
|
|
63
|
+
this._onDidChangeAgents.fire();
|
|
64
|
+
return toDisposable(() => {
|
|
65
|
+
if (this._agents.delete(data.id)) {
|
|
66
|
+
this._onDidChangeAgents.fire();
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
registerAgentCallback(id, agentCallback) {
|
|
71
|
+
const data = this._agents.get(id);
|
|
72
|
+
if (!data) {
|
|
73
|
+
throw new Error(`No agent with id ${id} registered`);
|
|
74
|
+
}
|
|
75
|
+
data.callback = agentCallback;
|
|
76
|
+
return toDisposable(() => data.callback = undefined);
|
|
77
|
+
}
|
|
78
|
+
registerAgent(data, callback) {
|
|
79
|
+
return combinedDisposable(this.registerAgentData(data), this.registerAgentCallback(data.id, callback));
|
|
80
|
+
}
|
|
81
|
+
getAgents() {
|
|
82
|
+
return Array.from(( this._agents.values()), v => v.data);
|
|
83
|
+
}
|
|
84
|
+
hasAgent(id) {
|
|
85
|
+
return ( this._agents.has(id));
|
|
86
|
+
}
|
|
87
|
+
getAgent(id) {
|
|
88
|
+
const data = this._agents.get(id);
|
|
89
|
+
return data?.data;
|
|
90
|
+
}
|
|
91
|
+
async invokeAgent(id, prompt, progress, history, token) {
|
|
92
|
+
const data = this._agents.get(id);
|
|
93
|
+
if (!data) {
|
|
94
|
+
throw new Error('No agent with id ${id} NOT registered');
|
|
95
|
+
}
|
|
96
|
+
if (!data.callback) {
|
|
97
|
+
await this._extensionService.activateByEvent(`onChatAgent:${id}`);
|
|
98
|
+
}
|
|
99
|
+
if (!data.callback) {
|
|
100
|
+
throw new Error(`No agent with id ${id} NOT resolved`);
|
|
101
|
+
}
|
|
102
|
+
return await data.callback(prompt, progress, history, token);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
let ChatAgentContribution = class ChatAgentContribution {
|
|
106
|
+
constructor(chatAgentService) {
|
|
107
|
+
const contributions = ( new DisposableStore());
|
|
108
|
+
agentsExtPoint.setHandler(extensions => {
|
|
109
|
+
contributions.clear();
|
|
110
|
+
for (const entry of extensions) {
|
|
111
|
+
if (!isProposedApiEnabled(entry.description, 'chatAgents')) {
|
|
112
|
+
entry.collector.error(`The ${agentsExtPoint.name} is proposed API`);
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
const { value } = entry;
|
|
116
|
+
for (const candidate of Iterable.wrap(value)) {
|
|
117
|
+
if (!isAgentData(candidate)) {
|
|
118
|
+
entry.collector.error(( localize(
|
|
119
|
+
'invalid',
|
|
120
|
+
"Invalid {0}: {1}",
|
|
121
|
+
agentsExtPoint.name,
|
|
122
|
+
JSON.stringify(candidate)
|
|
123
|
+
)));
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
contributions.add(chatAgentService.registerAgentData({ ...candidate }));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
ChatAgentContribution = ( __decorate([
|
|
133
|
+
( __param(0, IChatAgentService))
|
|
134
|
+
], ChatAgentContribution));
|
|
135
|
+
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(ChatAgentContribution, 3 );
|
|
136
|
+
export { IChatAgentService, agentsExtPoint };
|
|
@@ -29,6 +29,9 @@ class Response {
|
|
|
29
29
|
get onDidChangeValue() {
|
|
30
30
|
return this._onDidChangeValue.event;
|
|
31
31
|
}
|
|
32
|
+
get usedContext() {
|
|
33
|
+
return this._usedContext;
|
|
34
|
+
}
|
|
32
35
|
get value() {
|
|
33
36
|
return this._responseData;
|
|
34
37
|
}
|
|
@@ -71,6 +74,10 @@ class Response {
|
|
|
71
74
|
this._responseParts[responsePosition] = { string: ( new MarkdownString(content)), isPlaceholder: true };
|
|
72
75
|
this._updateRepr(quiet);
|
|
73
76
|
}
|
|
77
|
+
else if ('value' in content) {
|
|
78
|
+
this._responseParts[responsePosition] = { string: content, isPlaceholder: true };
|
|
79
|
+
this._updateRepr(quiet);
|
|
80
|
+
}
|
|
74
81
|
else if (content.treeData) {
|
|
75
82
|
this._responseParts[responsePosition] = { treeData: content.treeData };
|
|
76
83
|
this._updateRepr(quiet);
|
|
@@ -81,6 +88,9 @@ class Response {
|
|
|
81
88
|
this._responseParts.push(responsePart);
|
|
82
89
|
this._updateRepr(quiet);
|
|
83
90
|
}
|
|
91
|
+
else if ('documents' in responsePart) {
|
|
92
|
+
this._usedContext = responsePart;
|
|
93
|
+
}
|
|
84
94
|
}
|
|
85
95
|
_updateRepr(quiet) {
|
|
86
96
|
this._responseData = ( this._responseParts.map(part => {
|
|
@@ -133,14 +143,15 @@ class ChatResponseModel extends Disposable {
|
|
|
133
143
|
return this.session.providerId;
|
|
134
144
|
}
|
|
135
145
|
get username() {
|
|
136
|
-
return this.session.responderUsername;
|
|
146
|
+
return this.agent?.metadata.fullName ?? this.session.responderUsername;
|
|
137
147
|
}
|
|
138
148
|
get avatarIconUri() {
|
|
139
|
-
return this.session.responderAvatarIconUri;
|
|
149
|
+
return this.agent?.metadata.icon ?? this.session.responderAvatarIconUri;
|
|
140
150
|
}
|
|
141
|
-
constructor(_response, session, _isComplete = false, _isCanceled = false, _vote, _providerResponseId, _errorDetails, _followups) {
|
|
151
|
+
constructor(_response, session, agent, _isComplete = false, _isCanceled = false, _vote, _providerResponseId, _errorDetails, _followups) {
|
|
142
152
|
super();
|
|
143
153
|
this.session = session;
|
|
154
|
+
this.agent = agent;
|
|
144
155
|
this._isComplete = _isComplete;
|
|
145
156
|
this._isCanceled = _isCanceled;
|
|
146
157
|
this._vote = _vote;
|
|
@@ -1,3 +1,80 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Iterable } from 'monaco-editor/esm/vs/base/common/iterator.js';
|
|
3
|
+
import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
|
+
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
1
5
|
import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
6
|
+
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
7
|
+
import { Extensions } from '../../../common/contributions.js';
|
|
8
|
+
import { isProposedApiEnabled } from '../../../services/extensions/common/extensions.js';
|
|
9
|
+
import { ExtensionsRegistry } from '../../../services/extensions/common/extensionsRegistry.js';
|
|
10
|
+
const slashItem = {
|
|
11
|
+
type: 'object',
|
|
12
|
+
required: ['command', 'detail'],
|
|
13
|
+
properties: {
|
|
14
|
+
command: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
markdownDescription: ( localize('command', "The name of the slash command which will be used as prefix."))
|
|
17
|
+
},
|
|
18
|
+
detail: {
|
|
19
|
+
type: 'string',
|
|
20
|
+
markdownDescription: ( localize('details', "The details of the slash command."))
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const slashItems = {
|
|
25
|
+
description: ( localize(
|
|
26
|
+
'vscode.extension.contributes.slashes',
|
|
27
|
+
"Contributes slash commands to chat"
|
|
28
|
+
)),
|
|
29
|
+
oneOf: [
|
|
30
|
+
slashItem,
|
|
31
|
+
{
|
|
32
|
+
type: 'array',
|
|
33
|
+
items: slashItem
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
};
|
|
37
|
+
const slashesExtPoint = ( ExtensionsRegistry.registerExtensionPoint({
|
|
38
|
+
extensionPoint: 'slashes',
|
|
39
|
+
jsonSchema: slashItems
|
|
40
|
+
}));
|
|
41
|
+
function isChatSlashData(data) {
|
|
42
|
+
return typeof data === 'object' && data &&
|
|
43
|
+
typeof data.command === 'string' &&
|
|
44
|
+
typeof data.detail === 'string' &&
|
|
45
|
+
(typeof data.sortText === 'undefined' || typeof data.sortText === 'string') &&
|
|
46
|
+
(typeof data.executeImmediately === 'undefined' || typeof data.executeImmediately === 'boolean');
|
|
47
|
+
}
|
|
2
48
|
const IChatSlashCommandService = ( createDecorator('chatSlashCommandService'));
|
|
3
|
-
|
|
49
|
+
let ChatSlashCommandContribution = class ChatSlashCommandContribution {
|
|
50
|
+
constructor(slashCommandService) {
|
|
51
|
+
const contributions = ( new DisposableStore());
|
|
52
|
+
slashesExtPoint.setHandler(extensions => {
|
|
53
|
+
contributions.clear();
|
|
54
|
+
for (const entry of extensions) {
|
|
55
|
+
if (!isProposedApiEnabled(entry.description, 'chatSlashCommands')) {
|
|
56
|
+
entry.collector.error(`The ${slashesExtPoint.name} is proposed API`);
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const { value } = entry;
|
|
60
|
+
for (const candidate of Iterable.wrap(value)) {
|
|
61
|
+
if (!isChatSlashData(candidate)) {
|
|
62
|
+
entry.collector.error(( localize(
|
|
63
|
+
'invalid',
|
|
64
|
+
"Invalid {0}: {1}",
|
|
65
|
+
slashesExtPoint.name,
|
|
66
|
+
JSON.stringify(candidate)
|
|
67
|
+
)));
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
contributions.add(slashCommandService.registerSlashData({ ...candidate }));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
ChatSlashCommandContribution = ( __decorate([
|
|
77
|
+
( __param(0, IChatSlashCommandService))
|
|
78
|
+
], ChatSlashCommandContribution));
|
|
79
|
+
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(ChatSlashCommandContribution, 3 );
|
|
80
|
+
export { IChatSlashCommandService, slashesExtPoint };
|
|
@@ -8,14 +8,35 @@ import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
|
8
8
|
import { Extensions } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
|
|
9
9
|
import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
|
|
10
10
|
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
11
|
+
const createCodeActionsAutoSave = (description) => {
|
|
12
|
+
return {
|
|
13
|
+
type: ['string', 'boolean'],
|
|
14
|
+
enum: ['always', 'explicit', 'never', true, false],
|
|
15
|
+
enumDescriptions: [
|
|
16
|
+
( nls.localize(
|
|
17
|
+
'alwaysSave',
|
|
18
|
+
'Triggers Code Actions on explicit saves and auto saves triggered by window or focus changes.'
|
|
19
|
+
)),
|
|
20
|
+
( nls.localize('explicitSave', 'Triggers Code Actions only when explicitly saved')),
|
|
21
|
+
( nls.localize('neverSave', 'Never triggers Code Actions on save')),
|
|
22
|
+
( nls.localize(
|
|
23
|
+
'explicitSaveBoolean',
|
|
24
|
+
'Triggers Code Actions only when explicitly saved. This value will be deprecated in favor of "explicit".'
|
|
25
|
+
)),
|
|
26
|
+
( nls.localize(
|
|
27
|
+
'neverSaveBoolean',
|
|
28
|
+
'Never triggers Code Actions on save. This value will be deprecated in favor of "never".'
|
|
29
|
+
))
|
|
30
|
+
],
|
|
31
|
+
default: true,
|
|
32
|
+
description: description
|
|
33
|
+
};
|
|
34
|
+
};
|
|
11
35
|
const codeActionsOnSaveDefaultProperties = ( Object.freeze({
|
|
12
|
-
'source.fixAll':
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"Controls whether auto fix action should be run on file save."
|
|
17
|
-
))
|
|
18
|
-
}
|
|
36
|
+
'source.fixAll': createCodeActionsAutoSave(( nls.localize(
|
|
37
|
+
'codeActionsOnSave.fixAll',
|
|
38
|
+
"Controls whether auto fix action should be run on file save."
|
|
39
|
+
))),
|
|
19
40
|
}));
|
|
20
41
|
const codeActionsOnSaveSchema = {
|
|
21
42
|
oneOf: [
|
|
@@ -23,7 +44,7 @@ const codeActionsOnSaveSchema = {
|
|
|
23
44
|
type: 'object',
|
|
24
45
|
properties: codeActionsOnSaveDefaultProperties,
|
|
25
46
|
additionalProperties: {
|
|
26
|
-
type: 'boolean'
|
|
47
|
+
type: ['string', 'boolean']
|
|
27
48
|
},
|
|
28
49
|
},
|
|
29
50
|
{
|
|
@@ -31,8 +52,16 @@ const codeActionsOnSaveSchema = {
|
|
|
31
52
|
items: { type: 'string' }
|
|
32
53
|
}
|
|
33
54
|
],
|
|
55
|
+
markdownDescription: ( nls.localize(
|
|
56
|
+
'editor.codeActionsOnSave',
|
|
57
|
+
'Run CodeActions for the editor on save. CodeActions must be specified and the editor must not be shutting down. Example: `"source.organizeImports": "explicit" `'
|
|
58
|
+
)),
|
|
59
|
+
type: 'object',
|
|
60
|
+
additionalProperties: {
|
|
61
|
+
type: ['string', 'boolean'],
|
|
62
|
+
enum: ['always', 'explicit', 'never', true, false],
|
|
63
|
+
},
|
|
34
64
|
default: {},
|
|
35
|
-
description: ( nls.localize('codeActionsOnSave', "Code Action kinds to be run on save.")),
|
|
36
65
|
scope: 5 ,
|
|
37
66
|
};
|
|
38
67
|
const editorConfiguration = ( Object.freeze({
|
|
@@ -59,14 +88,11 @@ let CodeActionsContribution = class CodeActionsContribution extends Disposable {
|
|
|
59
88
|
updateConfigurationSchema(codeActionContributions) {
|
|
60
89
|
const newProperties = { ...codeActionsOnSaveDefaultProperties };
|
|
61
90
|
for (const [sourceAction, props] of this.getSourceActions(codeActionContributions)) {
|
|
62
|
-
newProperties[sourceAction] =
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
props.title
|
|
68
|
-
))
|
|
69
|
-
};
|
|
91
|
+
newProperties[sourceAction] = createCodeActionsAutoSave(( nls.localize(
|
|
92
|
+
'codeActionsOnSave.generic',
|
|
93
|
+
"Controls whether '{0}' actions should be run on file save.",
|
|
94
|
+
props.title
|
|
95
|
+
)));
|
|
70
96
|
}
|
|
71
97
|
codeActionsOnSaveSchema.properties = newProperties;
|
|
72
98
|
( Registry.as(Extensions.Configuration))
|
|
@@ -3,21 +3,22 @@ import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
|
3
3
|
import { observableFromEvent, autorunWithStore } from 'monaco-editor/esm/vs/base/common/observable.js';
|
|
4
4
|
import { registerDiffEditorContribution } from 'monaco-editor/esm/vs/editor/browser/editorExtensions.js';
|
|
5
5
|
import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
|
|
6
|
-
import { AccessibleDiffViewerNext, AccessibleDiffViewerPrev } from 'monaco-editor/esm/vs/editor/browser/widget/diffEditor.contribution.js';
|
|
7
|
-
import {
|
|
8
|
-
import { EmbeddedDiffEditorWidget
|
|
6
|
+
import { AccessibleDiffViewerNext, AccessibleDiffViewerPrev } from 'monaco-editor/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js';
|
|
7
|
+
import { DiffEditorWidget } from 'monaco-editor/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js';
|
|
8
|
+
import { EmbeddedDiffEditorWidget } from 'monaco-editor/esm/vs/editor/browser/widget/embeddedCodeEditorWidget.js';
|
|
9
9
|
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
10
10
|
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
11
|
-
import {
|
|
11
|
+
import { IContextKeyService, ContextKeyEqualsExpr } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
12
12
|
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
13
13
|
import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
|
|
14
14
|
import { Severity, INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
|
|
15
|
+
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
15
16
|
import { FloatingEditorClickWidget } from '../../../browser/codeeditor.js';
|
|
17
|
+
import { Extensions } from '../../../common/configuration.js';
|
|
18
|
+
import { getCommentCommandInfo } from '../../accessibility/browser/accessibilityContributions.js';
|
|
16
19
|
import { IAccessibleViewService } from '../../accessibility/browser/accessibleView.js';
|
|
17
20
|
import { AccessibilityHelpAction } from '../../accessibility/browser/accessibleViewActions.js';
|
|
18
21
|
import { IEditorService } from '../../../services/editor/common/editorService.js';
|
|
19
|
-
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
20
|
-
import { Extensions } from '../../../common/configuration.js';
|
|
21
22
|
let DiffEditorHelperContribution = class DiffEditorHelperContribution extends Disposable {
|
|
22
23
|
static { this.ID = 'editor.contrib.diffEditorHelper'; }
|
|
23
24
|
constructor(_diffEditor, _instantiationService, _configurationService, _notificationService) {
|
|
@@ -27,7 +28,7 @@ let DiffEditorHelperContribution = class DiffEditorHelperContribution extends Di
|
|
|
27
28
|
this._configurationService = _configurationService;
|
|
28
29
|
this._notificationService = _notificationService;
|
|
29
30
|
this._register(createScreenReaderHelp());
|
|
30
|
-
const isEmbeddedDiffEditor =
|
|
31
|
+
const isEmbeddedDiffEditor = this._diffEditor instanceof EmbeddedDiffEditorWidget;
|
|
31
32
|
if (!isEmbeddedDiffEditor) {
|
|
32
33
|
const computationResult = observableFromEvent(e => this._diffEditor.onDidUpdateDiff(e), () => this._diffEditor.getDiffComputationResult());
|
|
33
34
|
const onlyWhiteSpaceChange = ( computationResult.map(r => r && !r.identical && r.changes2.length === 0));
|
|
@@ -69,9 +70,10 @@ function createScreenReaderHelp() {
|
|
|
69
70
|
const editorService = accessor.get(IEditorService);
|
|
70
71
|
const codeEditorService = accessor.get(ICodeEditorService);
|
|
71
72
|
const keybindingService = accessor.get(IKeybindingService);
|
|
73
|
+
const contextKeyService = accessor.get(IContextKeyService);
|
|
72
74
|
const next = keybindingService.lookupKeybinding(AccessibleDiffViewerNext.id)?.getAriaLabel();
|
|
73
75
|
const previous = keybindingService.lookupKeybinding(AccessibleDiffViewerPrev.id)?.getAriaLabel();
|
|
74
|
-
if (!(editorService.activeTextEditorControl instanceof
|
|
76
|
+
if (!(editorService.activeTextEditorControl instanceof DiffEditorWidget)) {
|
|
75
77
|
return;
|
|
76
78
|
}
|
|
77
79
|
const codeEditor = codeEditorService.getActiveCodeEditor() || codeEditorService.getFocusedCodeEditor();
|
|
@@ -79,31 +81,33 @@ function createScreenReaderHelp() {
|
|
|
79
81
|
return;
|
|
80
82
|
}
|
|
81
83
|
const keys = ['audioCues.diffLineDeleted', 'audioCues.diffLineInserted', 'audioCues.diffLineModified'];
|
|
84
|
+
const content = [
|
|
85
|
+
( localize('msg1', "You are in a diff editor.")),
|
|
86
|
+
( localize(
|
|
87
|
+
'msg2',
|
|
88
|
+
"View the next ({0}) or previous ({1}) diff in diff review mode, which is optimized for screen readers.",
|
|
89
|
+
next,
|
|
90
|
+
previous
|
|
91
|
+
)),
|
|
92
|
+
( localize(
|
|
93
|
+
'msg3',
|
|
94
|
+
"To control which audio cues should be played, the following settings can be configured: {0}.",
|
|
95
|
+
keys.join(', ')
|
|
96
|
+
)),
|
|
97
|
+
];
|
|
98
|
+
const commentCommandInfo = getCommentCommandInfo(keybindingService, contextKeyService, codeEditor);
|
|
99
|
+
if (commentCommandInfo) {
|
|
100
|
+
content.push(commentCommandInfo);
|
|
101
|
+
}
|
|
82
102
|
accessibleViewService.show({
|
|
83
103
|
verbositySettingKey: "accessibility.verbosity.diffEditor" ,
|
|
84
|
-
provideContent: () =>
|
|
85
|
-
( localize('msg1', "You are in a diff editor.")),
|
|
86
|
-
( localize(
|
|
87
|
-
'msg2',
|
|
88
|
-
"Press {0} or {1} to view the next or previous diff in the diff review mode that is optimized for screen readers.",
|
|
89
|
-
next,
|
|
90
|
-
previous
|
|
91
|
-
)),
|
|
92
|
-
( localize(
|
|
93
|
-
'msg3',
|
|
94
|
-
"To control which audio cues should be played, the following settings can be configured: {0}.",
|
|
95
|
-
keys.join(', ')
|
|
96
|
-
)),
|
|
97
|
-
].join('\n\n'),
|
|
104
|
+
provideContent: () => content.join('\n\n'),
|
|
98
105
|
onClose: () => {
|
|
99
106
|
codeEditor.focus();
|
|
100
107
|
},
|
|
101
108
|
options: { type: "help" }
|
|
102
109
|
});
|
|
103
|
-
}, (
|
|
104
|
-
ContextKeyEqualsExpr.create('diffEditorVersion', 2),
|
|
105
|
-
ContextKeyEqualsExpr.create('isInDiffEditor', true)
|
|
106
|
-
)));
|
|
110
|
+
}, ContextKeyEqualsExpr.create('isInDiffEditor', true));
|
|
107
111
|
}
|
|
108
112
|
registerDiffEditorContribution(DiffEditorHelperContribution.ID, DiffEditorHelperContribution);
|
|
109
113
|
( Registry.as(Extensions.ConfigurationMigration))
|
|
@@ -26,7 +26,7 @@ let LargeFileOptimizationsWarner = class LargeFileOptimizationsWarner extends Di
|
|
|
26
26
|
comment: [
|
|
27
27
|
'Variable 0 will be a file name.'
|
|
28
28
|
]
|
|
29
|
-
}, "{0}: tokenization, wrapping, folding and sticky scroll have been turned off for this large file in order to reduce memory usage and avoid freezing or crashing.", path.basename(model.uri.path)));
|
|
29
|
+
}, "{0}: tokenization, wrapping, folding, codelens, word highlighting and sticky scroll have been turned off for this large file in order to reduce memory usage and avoid freezing or crashing.", path.basename(model.uri.path)));
|
|
30
30
|
this._notificationService.prompt(Severity.Info, message, [
|
|
31
31
|
{
|
|
32
32
|
label: ( nls.localize('removeOptimizations', "Forcefully Enable Features")),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
2
3
|
import * as strings from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
3
4
|
import { isCodeEditor } from 'monaco-editor/esm/vs/editor/browser/editorBrowser.js';
|
|
4
5
|
import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
|
|
@@ -6,6 +7,7 @@ import { trimTrailingWhitespace } from 'monaco-editor/esm/vs/editor/common/comma
|
|
|
6
7
|
import { EditOperation } from 'monaco-editor/esm/vs/editor/common/core/editOperation.js';
|
|
7
8
|
import { Position } from 'monaco-editor/esm/vs/editor/common/core/position.js';
|
|
8
9
|
import { Range } from 'monaco-editor/esm/vs/editor/common/core/range.js';
|
|
10
|
+
import { ILanguageFeaturesService } from 'monaco-editor/esm/vs/editor/common/services/languageFeatures.js';
|
|
9
11
|
import { applyCodeAction, ApplyCodeActionReason, getCodeActions } from 'monaco-editor/esm/vs/editor/contrib/codeAction/browser/codeAction.js';
|
|
10
12
|
import { CodeActionKind, CodeActionTriggerSource } from 'monaco-editor/esm/vs/editor/contrib/codeAction/common/types.js';
|
|
11
13
|
import { formatDocumentWithSelectedProvider, formatDocumentRangesWithSelectedProvider } from 'monaco-editor/esm/vs/editor/contrib/format/browser/format.js';
|
|
@@ -14,12 +16,10 @@ import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
|
14
16
|
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
15
17
|
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
16
18
|
import { Progress } from 'monaco-editor/esm/vs/platform/progress/common/progress.js';
|
|
17
|
-
import { ITextFileService } from '../../../services/textfile/common/textfiles.js';
|
|
18
|
-
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
19
|
-
import { Extensions } from '../../../common/contributions.js';
|
|
20
19
|
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
20
|
+
import { Extensions } from '../../../common/contributions.js';
|
|
21
21
|
import { getModifiedRanges } from '../../format/browser/formatModified.js';
|
|
22
|
-
import {
|
|
22
|
+
import { ITextFileService } from '../../../services/textfile/common/textfiles.js';
|
|
23
23
|
let TrimWhitespaceParticipant = class TrimWhitespaceParticipant {
|
|
24
24
|
constructor(configurationService, codeEditorService) {
|
|
25
25
|
this.configurationService = configurationService;
|
|
@@ -223,19 +223,25 @@ let CodeActionOnSaveParticipant = class CodeActionOnSaveParticipant {
|
|
|
223
223
|
if (!model.textEditorModel) {
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
|
-
if (env.reason !== 1 ) {
|
|
227
|
-
return undefined;
|
|
228
|
-
}
|
|
229
226
|
const textEditorModel = model.textEditorModel;
|
|
230
|
-
const settingsOverrides = { overrideIdentifier: textEditorModel.getLanguageId(), resource:
|
|
227
|
+
const settingsOverrides = { overrideIdentifier: textEditorModel.getLanguageId(), resource: textEditorModel.uri };
|
|
231
228
|
const setting = this.configurationService.getValue('editor.codeActionsOnSave', settingsOverrides);
|
|
232
229
|
if (!setting) {
|
|
233
230
|
return undefined;
|
|
234
231
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
const
|
|
232
|
+
if (env.reason === 2 ) {
|
|
233
|
+
return undefined;
|
|
234
|
+
}
|
|
235
|
+
const convertedSetting = {};
|
|
236
|
+
for (const key in setting) {
|
|
237
|
+
if (typeof setting[key] === 'boolean') {
|
|
238
|
+
convertedSetting[key] = setting[key] ? 'explicit' : 'never';
|
|
239
|
+
}
|
|
240
|
+
else if (typeof setting[key] === 'string') {
|
|
241
|
+
convertedSetting[key] = setting[key];
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
const codeActionsOnSave = this.createCodeActionsOnSave(( Object.keys(convertedSetting)));
|
|
239
245
|
if (!Array.isArray(setting)) {
|
|
240
246
|
codeActionsOnSave.sort((a, b) => {
|
|
241
247
|
if (CodeActionKind.SourceFixAll.contains(a)) {
|
|
@@ -253,13 +259,12 @@ let CodeActionOnSaveParticipant = class CodeActionOnSaveParticipant {
|
|
|
253
259
|
if (!codeActionsOnSave.length) {
|
|
254
260
|
return undefined;
|
|
255
261
|
}
|
|
256
|
-
const excludedActions =
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
.filter(x => setting[x] === false)
|
|
260
|
-
.map(x => ( new CodeActionKind(x))));
|
|
262
|
+
const excludedActions = ( ( Object.keys(setting))
|
|
263
|
+
.filter(x => convertedSetting[x] === 'never' || false)
|
|
264
|
+
.map(x => ( new CodeActionKind(x))));
|
|
261
265
|
progress.report({ message: ( localize('codeaction', "Quick Fixes")) });
|
|
262
|
-
|
|
266
|
+
const filteredSaveList = codeActionsOnSave.filter(x => convertedSetting[x.value] === 'always' || (convertedSetting[x.value] === 'explicit') && env.reason === 1 );
|
|
267
|
+
await this.applyOnSaveActions(textEditorModel, filteredSaveList, excludedActions, progress, token);
|
|
263
268
|
}
|
|
264
269
|
createCodeActionsOnSave(settingItems) {
|
|
265
270
|
const kinds = ( settingItems.map(x => ( new CodeActionKind(x))));
|