@codingame/monaco-vscode-api 1.82.6 → 1.83.1
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 +1371 -1254
- 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
|
@@ -18,7 +18,6 @@ import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspac
|
|
|
18
18
|
import { IWorkbenchEnvironmentService } from '../../environment/common/environmentService.js';
|
|
19
19
|
import { parseExtensionDevOptions } from './extensionDevOptions.js';
|
|
20
20
|
import { isMessageOfType, UIKind, createMessageOfType } from './extensionHostProtocol.js';
|
|
21
|
-
import { ExtensionHostExtensions } from './extensions.js';
|
|
22
21
|
let RemoteExtensionHost = class RemoteExtensionHost extends Disposable {
|
|
23
22
|
constructor(runningLocation, _initDataProvider, remoteSocketFactoryService, _contextService, _environmentService, _telemetryService, _logService, _loggerService, _labelService, remoteAuthorityResolverService, _extensionHostDebugService, _productService, _signService) {
|
|
24
23
|
super();
|
|
@@ -36,7 +35,7 @@ let RemoteExtensionHost = class RemoteExtensionHost extends Disposable {
|
|
|
36
35
|
this._productService = _productService;
|
|
37
36
|
this._signService = _signService;
|
|
38
37
|
this.startup = 1 ;
|
|
39
|
-
this.extensions =
|
|
38
|
+
this.extensions = null;
|
|
40
39
|
this._onExit = this._register(( new Emitter()));
|
|
41
40
|
this.onExit = this._onExit.event;
|
|
42
41
|
this.remoteAuthority = this._initDataProvider.remoteAuthority;
|
|
@@ -46,7 +45,7 @@ let RemoteExtensionHost = class RemoteExtensionHost extends Disposable {
|
|
|
46
45
|
const devOpts = parseExtensionDevOptions(this._environmentService);
|
|
47
46
|
this._isExtensionDevHost = devOpts.isExtensionDevHost;
|
|
48
47
|
}
|
|
49
|
-
|
|
48
|
+
start() {
|
|
50
49
|
const options = {
|
|
51
50
|
commit: this._productService.commit,
|
|
52
51
|
quality: this._productService.quality,
|
|
@@ -61,7 +60,6 @@ let RemoteExtensionHost = class RemoteExtensionHost extends Disposable {
|
|
|
61
60
|
logService: this._logService,
|
|
62
61
|
ipcLogger: null
|
|
63
62
|
};
|
|
64
|
-
const initDataPromise = this._initDataProvider.getInitData();
|
|
65
63
|
return this.remoteAuthorityResolverService.resolveAuthority(this._initDataProvider.remoteAuthority).then((resolverResult) => {
|
|
66
64
|
const startParams = {
|
|
67
65
|
language: platform.language,
|
|
@@ -101,7 +99,7 @@ let RemoteExtensionHost = class RemoteExtensionHost extends Disposable {
|
|
|
101
99
|
}, 60 * 1000);
|
|
102
100
|
const disposable = protocol.onMessage(msg => {
|
|
103
101
|
if (isMessageOfType(msg, 1 )) {
|
|
104
|
-
this._createExtHostInitData(
|
|
102
|
+
this._createExtHostInitData(isExtensionDevelopmentDebug).then(data => {
|
|
105
103
|
protocol.send(VSBuffer.fromString(JSON.stringify(data)));
|
|
106
104
|
});
|
|
107
105
|
return;
|
|
@@ -132,10 +130,10 @@ let RemoteExtensionHost = class RemoteExtensionHost extends Disposable {
|
|
|
132
130
|
}
|
|
133
131
|
this._onExit.fire([0, reconnectionToken]);
|
|
134
132
|
}
|
|
135
|
-
async _createExtHostInitData(
|
|
136
|
-
const remoteInitData = await
|
|
133
|
+
async _createExtHostInitData(isExtensionDevelopmentDebug) {
|
|
134
|
+
const remoteInitData = await this._initDataProvider.getInitData();
|
|
135
|
+
this.extensions = remoteInitData.extensions;
|
|
137
136
|
const workspace = this._contextService.getWorkspace();
|
|
138
|
-
const deltaExtensions = this.extensions.set(remoteInitData.allExtensions, remoteInitData.myExtensions);
|
|
139
137
|
return {
|
|
140
138
|
commit: this._productService.commit,
|
|
141
139
|
version: this._productService.version,
|
|
@@ -171,9 +169,7 @@ let RemoteExtensionHost = class RemoteExtensionHost extends Disposable {
|
|
|
171
169
|
includeStack: false,
|
|
172
170
|
logNative: Boolean(this._environmentService.debugExtensionHost.debugId)
|
|
173
171
|
},
|
|
174
|
-
|
|
175
|
-
activationEvents: deltaExtensions.addActivationEvents,
|
|
176
|
-
myExtensions: deltaExtensions.myToAdd,
|
|
172
|
+
extensions: this.extensions.toSnapshot(),
|
|
177
173
|
telemetryInfo: {
|
|
178
174
|
sessionId: this._telemetryService.sessionId,
|
|
179
175
|
machineId: this._telemetryService.machineId,
|
|
@@ -3,7 +3,7 @@ import { VSBuffer } from 'monaco-editor/esm/vs/base/common/buffer.js';
|
|
|
3
3
|
import { CancellationToken, CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
4
4
|
import * as errors from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
5
5
|
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
6
|
-
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
6
|
+
import { Disposable, DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
7
7
|
import { transformIncomingURIs } from '../../../../base/common/uriIpc.js';
|
|
8
8
|
import { CanceledLazyPromise, LazyPromise } from './lazyPromise.js';
|
|
9
9
|
import { getStringIdentifierForProxy, SerializableObjectWithBuffers, ProxyIdentifier } from './proxyIdentifier.js';
|
|
@@ -103,6 +103,7 @@ class RPCProtocol extends Disposable {
|
|
|
103
103
|
this._isDisposed = true;
|
|
104
104
|
( Object.keys(this._pendingRPCReplies)).forEach((msgId) => {
|
|
105
105
|
const pending = this._pendingRPCReplies[msgId];
|
|
106
|
+
delete this._pendingRPCReplies[msgId];
|
|
106
107
|
pending.resolveErr(errors.canceled());
|
|
107
108
|
});
|
|
108
109
|
}
|
|
@@ -368,14 +369,15 @@ class RPCProtocol extends Disposable {
|
|
|
368
369
|
const req = ++this._lastMessageId;
|
|
369
370
|
const callId = String(req);
|
|
370
371
|
const result = ( new LazyPromise());
|
|
372
|
+
const disposable = ( new DisposableStore());
|
|
371
373
|
if (cancellationToken) {
|
|
372
|
-
cancellationToken.onCancellationRequested(() => {
|
|
374
|
+
disposable.add(cancellationToken.onCancellationRequested(() => {
|
|
373
375
|
const msg = MessageIO.serializeCancel(req);
|
|
374
376
|
this._logger?.logOutgoing(msg.byteLength, req, 0 , `cancel`);
|
|
375
377
|
this._protocol.send(MessageIO.serializeCancel(req));
|
|
376
|
-
});
|
|
378
|
+
}));
|
|
377
379
|
}
|
|
378
|
-
this._pendingRPCReplies[callId] = result;
|
|
380
|
+
this._pendingRPCReplies[callId] = ( new PendingRPCReply(result, disposable));
|
|
379
381
|
this._onWillSendRequest(req);
|
|
380
382
|
const msg = MessageIO.serializeRequest(req, rpcId, methodName, serializedRequestArguments, !!cancellationToken);
|
|
381
383
|
this._logger?.logOutgoing(msg.byteLength, req, 0 , `request: ${getStringIdentifierForProxy(rpcId)}.${methodName}(`, args);
|
|
@@ -383,6 +385,20 @@ class RPCProtocol extends Disposable {
|
|
|
383
385
|
return result;
|
|
384
386
|
}
|
|
385
387
|
}
|
|
388
|
+
class PendingRPCReply {
|
|
389
|
+
constructor(_promise, _disposable) {
|
|
390
|
+
this._promise = _promise;
|
|
391
|
+
this._disposable = _disposable;
|
|
392
|
+
}
|
|
393
|
+
resolveOk(value) {
|
|
394
|
+
this._promise.resolveOk(value);
|
|
395
|
+
this._disposable.dispose();
|
|
396
|
+
}
|
|
397
|
+
resolveErr(err) {
|
|
398
|
+
this._promise.resolveErr(err);
|
|
399
|
+
this._disposable.dispose();
|
|
400
|
+
}
|
|
401
|
+
}
|
|
386
402
|
class MessageBuffer {
|
|
387
403
|
static alloc(type, req, messageSize) {
|
|
388
404
|
const result = ( new MessageBuffer(VSBuffer.alloc(messageSize + 1 + 4 ), 0));
|
|
@@ -224,7 +224,28 @@ let WorkbenchKeybindingService = WorkbenchKeybindingService_1 = class WorkbenchK
|
|
|
224
224
|
});
|
|
225
225
|
this.updateKeybindingsJsonSchema();
|
|
226
226
|
this._register(extensionService.onDidRegisterExtensions(() => this.updateKeybindingsJsonSchema()));
|
|
227
|
-
this._register(
|
|
227
|
+
this._register(this._registerKeyListeners(window));
|
|
228
|
+
this._register(dom.onDidCreateWindow(({ window, disposableStore }) => {
|
|
229
|
+
disposableStore.add(this._registerKeyListeners(window));
|
|
230
|
+
}));
|
|
231
|
+
this._register(browser.onDidChangeFullscreen(() => {
|
|
232
|
+
const keyboard = navigator.keyboard;
|
|
233
|
+
if (BrowserFeatures.keyboard === 2 ) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
if (browser.isFullscreen()) {
|
|
237
|
+
keyboard?.lock(['Escape']);
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
keyboard?.unlock();
|
|
241
|
+
}
|
|
242
|
+
this._cachedResolver = null;
|
|
243
|
+
this._onDidUpdateKeybindings.fire();
|
|
244
|
+
}));
|
|
245
|
+
}
|
|
246
|
+
_registerKeyListeners(window) {
|
|
247
|
+
const disposables = ( new DisposableStore());
|
|
248
|
+
disposables.add(dom.addDisposableListener(window, dom.EventType.KEY_DOWN, (e) => {
|
|
228
249
|
this.isComposingGlobalContextKey.set(e.isComposing);
|
|
229
250
|
const keyEvent = ( new StandardKeyboardEvent(e));
|
|
230
251
|
this._log(`/ Received keydown event - ${printKeyboardEvent(e)}`);
|
|
@@ -235,7 +256,7 @@ let WorkbenchKeybindingService = WorkbenchKeybindingService_1 = class WorkbenchK
|
|
|
235
256
|
}
|
|
236
257
|
this.isComposingGlobalContextKey.set(false);
|
|
237
258
|
}));
|
|
238
|
-
|
|
259
|
+
disposables.add(dom.addDisposableListener(window, dom.EventType.KEY_UP, (e) => {
|
|
239
260
|
this.isComposingGlobalContextKey.set(e.isComposing);
|
|
240
261
|
const keyEvent = ( new StandardKeyboardEvent(e));
|
|
241
262
|
const shouldPreventDefault = this._singleModifierDispatch(keyEvent, keyEvent.target);
|
|
@@ -244,20 +265,7 @@ let WorkbenchKeybindingService = WorkbenchKeybindingService_1 = class WorkbenchK
|
|
|
244
265
|
}
|
|
245
266
|
this.isComposingGlobalContextKey.set(false);
|
|
246
267
|
}));
|
|
247
|
-
|
|
248
|
-
const keyboard = navigator.keyboard;
|
|
249
|
-
if (BrowserFeatures.keyboard === 2 ) {
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
if (browser.isFullscreen()) {
|
|
253
|
-
keyboard?.lock(['Escape']);
|
|
254
|
-
}
|
|
255
|
-
else {
|
|
256
|
-
keyboard?.unlock();
|
|
257
|
-
}
|
|
258
|
-
this._cachedResolver = null;
|
|
259
|
-
this._onDidUpdateKeybindings.fire();
|
|
260
|
-
}));
|
|
268
|
+
return disposables;
|
|
261
269
|
}
|
|
262
270
|
registerSchemaContribution(contribution) {
|
|
263
271
|
this._contributions.push(contribution);
|
|
@@ -6,7 +6,6 @@ const OUTPUT_MIME = 'text/x-code-output';
|
|
|
6
6
|
const OUTPUT_SCHEME = 'output';
|
|
7
7
|
const OUTPUT_MODE_ID = 'Log';
|
|
8
8
|
const LOG_MIME = 'text/x-code-log-output';
|
|
9
|
-
const LOG_SCHEME = 'log';
|
|
10
9
|
const LOG_MODE_ID = 'log';
|
|
11
10
|
const OUTPUT_VIEW_ID = 'workbench.panel.output';
|
|
12
11
|
const CONTEXT_IN_OUTPUT = ( new RawContextKey('inOutput', false));
|
|
@@ -51,4 +50,4 @@ class OutputChannelRegistry {
|
|
|
51
50
|
}
|
|
52
51
|
Registry.add(Extensions.OutputChannels, ( new OutputChannelRegistry()));
|
|
53
52
|
const ACTIVE_OUTPUT_CHANNEL_CONTEXT = ( new RawContextKey('activeOutputChannel', ''));
|
|
54
|
-
export { ACTIVE_OUTPUT_CHANNEL_CONTEXT, CONTEXT_ACTIVE_LOG_OUTPUT, CONTEXT_IN_OUTPUT, CONTEXT_OUTPUT_SCROLL_LOCK, Extensions, IOutputService, LOG_MIME, LOG_MODE_ID,
|
|
53
|
+
export { ACTIVE_OUTPUT_CHANNEL_CONTEXT, CONTEXT_ACTIVE_LOG_OUTPUT, CONTEXT_IN_OUTPUT, CONTEXT_OUTPUT_SCROLL_LOCK, Extensions, IOutputService, LOG_MIME, LOG_MODE_ID, OUTPUT_MIME, OUTPUT_MODE_ID, OUTPUT_SCHEME, OUTPUT_VIEW_ID, OutputChannelUpdateMode };
|
|
@@ -4,8 +4,8 @@ import { Event } from '../../../../base/common/event.js';
|
|
|
4
4
|
import { IJSONSchemaMap, IJSONSchema } from '../../../../base/common/jsonSchema.js';
|
|
5
5
|
import { URI } from '../../../../base/common/uri.js';
|
|
6
6
|
import { IRange } from '../../../../editor/common/core/range.js';
|
|
7
|
-
import { ITextModel } from '../../../../editor/common/model.js';
|
|
8
7
|
import { IExtensionInfo, ConfigurationScope, EditPresentationTypes } from '../../../../platform/configuration/common/configurationRegistry.js';
|
|
8
|
+
import { ITextModel } from '../../../../editor/common/model.js';
|
|
9
9
|
import { ConfigurationTarget } from '../../../../platform/configuration/common/configuration.js';
|
|
10
10
|
import { IEditorOptions } from '../../../../platform/editor/common/editor.js';
|
|
11
11
|
import { IEditorPane } from '../../../common/editor.js';
|
|
@@ -60,13 +60,13 @@ interface ISetting {
|
|
|
60
60
|
editPresentation?: EditPresentationTypes;
|
|
61
61
|
nonLanguageSpecificDefaultValueSource?: string | IExtensionInfo;
|
|
62
62
|
isLanguageTagSetting?: boolean;
|
|
63
|
-
categoryOrder?: number;
|
|
64
63
|
categoryLabel?: string;
|
|
65
64
|
displayExtensionId?: string;
|
|
66
65
|
stableExtensionId?: string;
|
|
67
66
|
prereleaseExtensionId?: string;
|
|
68
67
|
title?: string;
|
|
69
68
|
extensionGroupTitle?: string;
|
|
69
|
+
internalOrder?: number;
|
|
70
70
|
}
|
|
71
71
|
interface ISearchResult {
|
|
72
72
|
filterMatches: ISettingMatch[];
|
|
@@ -90,13 +90,13 @@ interface IFilterResult {
|
|
|
90
90
|
/**
|
|
91
91
|
* The ways a setting could match a query,
|
|
92
92
|
* sorted in increasing order of relevance.
|
|
93
|
-
* For now, ignore description and value matches.
|
|
94
93
|
*/
|
|
95
94
|
declare enum SettingMatchType {
|
|
96
95
|
None = 0,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
LanguageTagSettingMatch = 1,
|
|
97
|
+
RemoteMatch = 2,
|
|
98
|
+
DescriptionOrValueMatch = 4,
|
|
99
|
+
KeyMatch = 8
|
|
100
100
|
}
|
|
101
101
|
interface ISettingMatch {
|
|
102
102
|
setting: ISetting;
|
|
@@ -23,9 +23,10 @@ var SettingValueType;
|
|
|
23
23
|
var SettingMatchType;
|
|
24
24
|
( (function(SettingMatchType) {
|
|
25
25
|
SettingMatchType[SettingMatchType["None"] = 0] = "None";
|
|
26
|
-
SettingMatchType[SettingMatchType["
|
|
27
|
-
SettingMatchType[SettingMatchType["
|
|
28
|
-
SettingMatchType[SettingMatchType["
|
|
26
|
+
SettingMatchType[SettingMatchType["LanguageTagSettingMatch"] = 1] = "LanguageTagSettingMatch";
|
|
27
|
+
SettingMatchType[SettingMatchType["RemoteMatch"] = 2] = "RemoteMatch";
|
|
28
|
+
SettingMatchType[SettingMatchType["DescriptionOrValueMatch"] = 4] = "DescriptionOrValueMatch";
|
|
29
|
+
SettingMatchType[SettingMatchType["KeyMatch"] = 8] = "KeyMatch";
|
|
29
30
|
})(SettingMatchType || (SettingMatchType = {})));
|
|
30
31
|
function validateSettingsEditorOptions(options) {
|
|
31
32
|
return {
|
|
@@ -13,7 +13,6 @@ declare abstract class AbstractSettingsModel extends EditorModel {
|
|
|
13
13
|
* Remove duplicates between result groups, preferring results in earlier groups
|
|
14
14
|
*/
|
|
15
15
|
private removeDuplicateResults;
|
|
16
|
-
private compareTwoNullableNumbers;
|
|
17
16
|
filterSettings(filter: string, groupFilter: IGroupFilter, settingMatcher: ISettingMatcher): ISettingMatch[];
|
|
18
17
|
getPreference(key: string): ISetting | undefined;
|
|
19
18
|
protected collectMetadata(groups: ISearchResultGroup[]): IStringDictionary<IFilterMetadata>;
|
|
@@ -236,7 +236,7 @@ class FileSearchManager {
|
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
doSearch(engine, batchSize, onResultBatch, token) {
|
|
239
|
-
token.onCancellationRequested(() => {
|
|
239
|
+
const listener = token.onCancellationRequested(() => {
|
|
240
240
|
engine.cancel();
|
|
241
241
|
});
|
|
242
242
|
const _onResult = (match) => {
|
|
@@ -253,11 +253,13 @@ class FileSearchManager {
|
|
|
253
253
|
if (batch.length) {
|
|
254
254
|
onResultBatch(batch);
|
|
255
255
|
}
|
|
256
|
+
listener.dispose();
|
|
256
257
|
return result;
|
|
257
258
|
}, error => {
|
|
258
259
|
if (batch.length) {
|
|
259
260
|
onResultBatch(batch);
|
|
260
261
|
}
|
|
262
|
+
listener.dispose();
|
|
261
263
|
return Promise.reject(error);
|
|
262
264
|
});
|
|
263
265
|
}
|
|
@@ -9,6 +9,7 @@ import { isCancellationError } from 'monaco-editor/esm/vs/base/common/errors.js'
|
|
|
9
9
|
import { isThenable } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
10
10
|
const VIEWLET_ID = 'workbench.view.search';
|
|
11
11
|
const VIEW_ID = 'workbench.view.search';
|
|
12
|
+
const SEARCH_RESULT_LANGUAGE_ID = 'search-result';
|
|
12
13
|
const SEARCH_EXCLUDE_CONFIG = 'search.exclude';
|
|
13
14
|
const SEARCH_ELIDED_PREFIX = '⟪ ';
|
|
14
15
|
const SEARCH_ELIDED_SUFFIX = ' characters skipped ⟫';
|
|
@@ -272,4 +273,4 @@ function listToMap(list) {
|
|
|
272
273
|
}
|
|
273
274
|
return map;
|
|
274
275
|
}
|
|
275
|
-
export { FileMatch, ISearchService, OneLineRange, QueryGlobTester, SEARCH_EXCLUDE_CONFIG, SearchError, SearchErrorCode, SearchRange, TextSearchMatch, VIEWLET_ID, VIEW_ID, deserializeSearchError, getExcludes, hasSiblingFn, hasSiblingPromiseFn, isFileMatch, isProgressMessage, pathIncludedInQuery, resolvePatternsForProvider, resultIsMatch };
|
|
276
|
+
export { FileMatch, ISearchService, OneLineRange, QueryGlobTester, SEARCH_EXCLUDE_CONFIG, SEARCH_RESULT_LANGUAGE_ID, SearchError, SearchErrorCode, SearchRange, TextSearchMatch, VIEWLET_ID, VIEW_ID, deserializeSearchError, getExcludes, hasSiblingFn, hasSiblingPromiseFn, isFileMatch, isProgressMessage, pathIncludedInQuery, resolvePatternsForProvider, resultIsMatch };
|
|
@@ -19,8 +19,7 @@ class TextSearchManager {
|
|
|
19
19
|
}
|
|
20
20
|
search(onProgress, token) {
|
|
21
21
|
const folderQueries = this.query.folderQueries || [];
|
|
22
|
-
const tokenSource = ( new CancellationTokenSource());
|
|
23
|
-
token.onCancellationRequested(() => tokenSource.cancel());
|
|
22
|
+
const tokenSource = ( new CancellationTokenSource(token));
|
|
24
23
|
return ( new Promise((resolve, reject) => {
|
|
25
24
|
this.collector = ( new TextSearchResultsCollector(onProgress));
|
|
26
25
|
let isCanceled = false;
|
|
@@ -17,7 +17,7 @@ import { IWorkingCopyService } from '../../workingCopy/common/workingCopyService
|
|
|
17
17
|
import { NO_TYPE_ID } from '../../workingCopy/common/workingCopy.js';
|
|
18
18
|
import { IFilesConfigurationService } from '../../filesConfiguration/common/filesConfigurationService.js';
|
|
19
19
|
import { ILabelService } from 'monaco-editor/esm/vs/platform/label/common/label.js';
|
|
20
|
-
import { CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
20
|
+
import { CancellationToken, CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
21
21
|
import { UTF8, UTF8_with_bom, UTF16be, UTF16le } from './encoding.js';
|
|
22
22
|
import { createTextBufferFactoryFromStream } from 'monaco-editor/esm/vs/editor/common/model/textModel.js';
|
|
23
23
|
import { ILanguageDetectionService } from '../../languageDetection/common/languageDetectionWorkerService.js';
|
|
@@ -106,7 +106,7 @@ let TextFileEditorModel = class TextFileEditorModel extends BaseTextEditorModel
|
|
|
106
106
|
if (fileEventImpactsModel && this.inOrphanMode !== newInOrphanModeGuess) {
|
|
107
107
|
let newInOrphanModeValidated = false;
|
|
108
108
|
if (newInOrphanModeGuess) {
|
|
109
|
-
await timeout(100);
|
|
109
|
+
await timeout(100, CancellationToken.None);
|
|
110
110
|
if (this.isDisposed()) {
|
|
111
111
|
newInOrphanModeValidated = true;
|
|
112
112
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
1
|
import { Promises } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
3
2
|
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
4
3
|
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
5
4
|
import { equals } from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
6
5
|
import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
|
|
7
|
-
import { IUserDataProfilesService } from 'monaco-editor/esm/vs/platform/userDataProfile/common/userDataProfile.js';
|
|
8
6
|
import { defaultUserDataProfileIcon } from './userDataProfile.js';
|
|
9
|
-
|
|
7
|
+
class UserDataProfileService extends Disposable {
|
|
10
8
|
get currentProfile() { return this._currentProfile; }
|
|
11
|
-
constructor(currentProfile
|
|
9
|
+
constructor(currentProfile) {
|
|
12
10
|
super();
|
|
13
11
|
this._onDidChangeCurrentProfile = this._register(( new Emitter()));
|
|
14
12
|
this.onDidChangeCurrentProfile = this._onDidChangeCurrentProfile.event;
|
|
@@ -36,8 +34,5 @@ let UserDataProfileService = class UserDataProfileService extends Disposable {
|
|
|
36
34
|
}
|
|
37
35
|
return `$(${defaultUserDataProfileIcon.id})`;
|
|
38
36
|
}
|
|
39
|
-
}
|
|
40
|
-
UserDataProfileService = ( __decorate([
|
|
41
|
-
( __param(1, IUserDataProfilesService))
|
|
42
|
-
], UserDataProfileService));
|
|
37
|
+
}
|
|
43
38
|
export { UserDataProfileService };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { timeout } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
3
|
+
import { CancellationToken } from 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
3
4
|
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
4
5
|
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
5
6
|
import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
@@ -13,7 +14,6 @@ let ResourceWorkingCopy = class ResourceWorkingCopy extends Disposable {
|
|
|
13
14
|
this.orphaned = false;
|
|
14
15
|
this._onWillDispose = this._register(( new Emitter()));
|
|
15
16
|
this.onWillDispose = this._onWillDispose.event;
|
|
16
|
-
this.disposed = false;
|
|
17
17
|
this._register(this.fileService.onDidFilesChange(e => this.onDidFilesChange(e)));
|
|
18
18
|
}
|
|
19
19
|
isOrphaned() {
|
|
@@ -39,7 +39,7 @@ let ResourceWorkingCopy = class ResourceWorkingCopy extends Disposable {
|
|
|
39
39
|
if (fileEventImpactsUs && this.orphaned !== newInOrphanModeGuess) {
|
|
40
40
|
let newInOrphanModeValidated = false;
|
|
41
41
|
if (newInOrphanModeGuess) {
|
|
42
|
-
await timeout(100);
|
|
42
|
+
await timeout(100, CancellationToken.None);
|
|
43
43
|
if (this.isDisposed()) {
|
|
44
44
|
newInOrphanModeValidated = true;
|
|
45
45
|
}
|
|
@@ -60,10 +60,9 @@ let ResourceWorkingCopy = class ResourceWorkingCopy extends Disposable {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
isDisposed() {
|
|
63
|
-
return this.
|
|
63
|
+
return this._store.isDisposed;
|
|
64
64
|
}
|
|
65
65
|
dispose() {
|
|
66
|
-
this.disposed = true;
|
|
67
66
|
this.orphaned = false;
|
|
68
67
|
this._onWillDispose.fire();
|
|
69
68
|
super.dispose();
|
|
@@ -315,8 +315,9 @@ WorkingCopyBackupServiceImpl = WorkingCopyBackupServiceImpl_1 = ( (__decorate([
|
|
|
315
315
|
( (__param(1, IFileService))),
|
|
316
316
|
( (__param(2, ILogService)))
|
|
317
317
|
], WorkingCopyBackupServiceImpl)));
|
|
318
|
-
class InMemoryWorkingCopyBackupService {
|
|
318
|
+
class InMemoryWorkingCopyBackupService extends Disposable {
|
|
319
319
|
constructor() {
|
|
320
|
+
super();
|
|
320
321
|
this.backups = ( (new ResourceMap()));
|
|
321
322
|
}
|
|
322
323
|
async hasBackups() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
2
2
|
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
3
3
|
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
4
|
-
import { Disposable,
|
|
4
|
+
import { Disposable, DisposableMap, toDisposable, DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
5
5
|
import { ResourceMap } from 'monaco-editor/esm/vs/base/common/map.js';
|
|
6
6
|
const IWorkingCopyService = ( createDecorator('workingCopyService'));
|
|
7
7
|
class WorkingCopyService extends Disposable {
|
|
@@ -19,6 +19,7 @@ class WorkingCopyService extends Disposable {
|
|
|
19
19
|
this.onDidSave = this._onDidSave.event;
|
|
20
20
|
this._workingCopies = ( new Set());
|
|
21
21
|
this.mapResourceToWorkingCopies = ( new ResourceMap());
|
|
22
|
+
this.mapWorkingCopyToListeners = this._register(( new DisposableMap()));
|
|
22
23
|
}
|
|
23
24
|
get workingCopies() { return Array.from(( this._workingCopies.values())); }
|
|
24
25
|
registerWorkingCopy(workingCopy) {
|
|
@@ -36,13 +37,13 @@ class WorkingCopyService extends Disposable {
|
|
|
36
37
|
disposables.add(workingCopy.onDidChangeContent(() => this._onDidChangeContent.fire(workingCopy)));
|
|
37
38
|
disposables.add(workingCopy.onDidChangeDirty(() => this._onDidChangeDirty.fire(workingCopy)));
|
|
38
39
|
disposables.add(workingCopy.onDidSave(e => this._onDidSave.fire({ workingCopy, ...e })));
|
|
40
|
+
this.mapWorkingCopyToListeners.set(workingCopy, disposables);
|
|
39
41
|
this._onDidRegister.fire(workingCopy);
|
|
40
42
|
if (workingCopy.isDirty()) {
|
|
41
43
|
this._onDidChangeDirty.fire(workingCopy);
|
|
42
44
|
}
|
|
43
45
|
return toDisposable(() => {
|
|
44
46
|
this.unregisterWorkingCopy(workingCopy);
|
|
45
|
-
dispose(disposables);
|
|
46
47
|
this._onDidUnregister.fire(workingCopy);
|
|
47
48
|
});
|
|
48
49
|
}
|
|
@@ -55,6 +56,7 @@ class WorkingCopyService extends Disposable {
|
|
|
55
56
|
if (workingCopy.isDirty()) {
|
|
56
57
|
this._onDidChangeDirty.fire(workingCopy);
|
|
57
58
|
}
|
|
59
|
+
this.mapWorkingCopyToListeners.deleteAndDispose(workingCopy);
|
|
58
60
|
}
|
|
59
61
|
has(resourceOrIdentifier) {
|
|
60
62
|
if (URI.isUri(resourceOrIdentifier)) {
|
package/vscode/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.contribution.js
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
|
|
2
|
-
import { EditorAction2 } from 'monaco-editor/esm/vs/editor/browser/editorExtensions.js';
|
|
3
|
-
import { findFocusedDiffEditor } from 'monaco-editor/esm/vs/editor/browser/widget/diffEditor.contribution.js';
|
|
4
|
-
import { DiffEditorWidget2 } from 'monaco-editor/esm/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.js';
|
|
5
|
-
import { EditorContextKeys } from 'monaco-editor/esm/vs/editor/common/editorContextKeys.js';
|
|
6
|
-
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
7
|
-
import { registerAction2, MenuRegistry, MenuId, Action2 } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
8
|
-
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
9
|
-
import { ContextKeyExpr, ContextKeyEqualsExpr } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
10
|
-
class ToggleCollapseUnchangedRegions extends Action2 {
|
|
11
|
-
constructor() {
|
|
12
|
-
super({
|
|
13
|
-
id: 'diffEditor.toggleCollapseUnchangedRegions',
|
|
14
|
-
title: { value: ( localize('toggleCollapseUnchangedRegions', "Toggle Collapse Unchanged Regions")), original: 'Toggle Collapse Unchanged Regions' },
|
|
15
|
-
icon: Codicon.map,
|
|
16
|
-
precondition: ContextKeyEqualsExpr.create('diffEditorVersion', 2),
|
|
17
|
-
toggled: ( ContextKeyExpr.has('config.diffEditor.hideUnchangedRegions.enabled')),
|
|
18
|
-
menu: {
|
|
19
|
-
id: MenuId.EditorTitle,
|
|
20
|
-
order: 22,
|
|
21
|
-
group: 'navigation',
|
|
22
|
-
when: ContextKeyEqualsExpr.create('diffEditorVersion', 2),
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
run(accessor, ...args) {
|
|
27
|
-
const configurationService = accessor.get(IConfigurationService);
|
|
28
|
-
const newValue = !configurationService.getValue('diffEditor.hideUnchangedRegions.enabled');
|
|
29
|
-
configurationService.updateValue('diffEditor.hideUnchangedRegions.enabled', newValue);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
registerAction2(ToggleCollapseUnchangedRegions);
|
|
33
|
-
class ToggleShowMovedCodeBlocks extends Action2 {
|
|
34
|
-
constructor() {
|
|
35
|
-
super({
|
|
36
|
-
id: 'diffEditor.toggleShowMovedCodeBlocks',
|
|
37
|
-
title: { value: ( localize('toggleShowMovedCodeBlocks', "Toggle Show Moved Code Blocks")), original: 'Toggle Show Moved Code Blocks' },
|
|
38
|
-
precondition: ContextKeyEqualsExpr.create('diffEditorVersion', 2),
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
run(accessor, ...args) {
|
|
42
|
-
const configurationService = accessor.get(IConfigurationService);
|
|
43
|
-
const newValue = !configurationService.getValue('diffEditor.experimental.showMoves');
|
|
44
|
-
configurationService.updateValue('diffEditor.experimental.showMoves', newValue);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
registerAction2(ToggleShowMovedCodeBlocks);
|
|
48
|
-
class ToggleUseInlineViewWhenSpaceIsLimited extends Action2 {
|
|
49
|
-
constructor() {
|
|
50
|
-
super({
|
|
51
|
-
id: 'diffEditor.toggleUseInlineViewWhenSpaceIsLimited',
|
|
52
|
-
title: { value: ( localize(
|
|
53
|
-
'toggleUseInlineViewWhenSpaceIsLimited',
|
|
54
|
-
"Toggle Use Inline View When Space Is Limited"
|
|
55
|
-
)), original: 'Toggle Use Inline View When Space Is Limited' },
|
|
56
|
-
precondition: ContextKeyEqualsExpr.create('diffEditorVersion', 2),
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
run(accessor, ...args) {
|
|
60
|
-
const configurationService = accessor.get(IConfigurationService);
|
|
61
|
-
const newValue = !configurationService.getValue('diffEditor.useInlineViewWhenSpaceIsLimited');
|
|
62
|
-
configurationService.updateValue('diffEditor.useInlineViewWhenSpaceIsLimited', newValue);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
registerAction2(ToggleUseInlineViewWhenSpaceIsLimited);
|
|
66
|
-
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
|
67
|
-
command: {
|
|
68
|
-
id: ( new ToggleUseInlineViewWhenSpaceIsLimited()).desc.id,
|
|
69
|
-
title: ( localize('useInlineViewWhenSpaceIsLimited', "Use Inline View When Space Is Limited")),
|
|
70
|
-
toggled: ( ContextKeyExpr.has('config.diffEditor.useInlineViewWhenSpaceIsLimited')),
|
|
71
|
-
},
|
|
72
|
-
order: 11,
|
|
73
|
-
group: '1_diff',
|
|
74
|
-
when: ( ContextKeyExpr.and(
|
|
75
|
-
EditorContextKeys.diffEditorRenderSideBySideInlineBreakpointReached,
|
|
76
|
-
ContextKeyEqualsExpr.create('diffEditorVersion', 2)
|
|
77
|
-
))
|
|
78
|
-
});
|
|
79
|
-
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
|
80
|
-
command: {
|
|
81
|
-
id: ( new ToggleShowMovedCodeBlocks()).desc.id,
|
|
82
|
-
title: ( localize('showMoves', "Show Moved Code Blocks")),
|
|
83
|
-
icon: Codicon.move,
|
|
84
|
-
toggled: ContextKeyEqualsExpr.create('config.diffEditor.experimental.showMoves', true),
|
|
85
|
-
},
|
|
86
|
-
order: 10,
|
|
87
|
-
group: '1_diff',
|
|
88
|
-
when: ContextKeyEqualsExpr.create('diffEditorVersion', 2)
|
|
89
|
-
});
|
|
90
|
-
const diffEditorCategory = {
|
|
91
|
-
value: ( localize('diffEditor', 'Diff Editor')),
|
|
92
|
-
original: 'Diff Editor',
|
|
93
|
-
};
|
|
94
|
-
class SwitchSide extends EditorAction2 {
|
|
95
|
-
constructor() {
|
|
96
|
-
super({
|
|
97
|
-
id: 'diffEditor.switchSide',
|
|
98
|
-
title: { value: ( localize('switchSide', "Switch Side")), original: 'Switch Side' },
|
|
99
|
-
icon: Codicon.arrowSwap,
|
|
100
|
-
precondition: ( ContextKeyExpr.and(ContextKeyEqualsExpr.create('diffEditorVersion', 2), ( ContextKeyExpr.has('isInDiffEditor')))),
|
|
101
|
-
f1: true,
|
|
102
|
-
category: diffEditorCategory,
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
runEditorCommand(accessor, editor, arg) {
|
|
106
|
-
const diffEditor = findFocusedDiffEditor(accessor);
|
|
107
|
-
if (diffEditor instanceof DiffEditorWidget2) {
|
|
108
|
-
if (arg && arg.dryRun) {
|
|
109
|
-
return { destinationSelection: diffEditor.mapToOtherSide().destinationSelection };
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
diffEditor.switchSide();
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return undefined;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
registerAction2(SwitchSide);
|
|
119
|
-
class ExitCompareMove extends EditorAction2 {
|
|
120
|
-
constructor() {
|
|
121
|
-
super({
|
|
122
|
-
id: 'diffEditor.exitCompareMove',
|
|
123
|
-
title: { value: ( localize('exitCompareMove', "Exit Compare Move")), original: 'Exit Compare Move' },
|
|
124
|
-
icon: Codicon.close,
|
|
125
|
-
precondition: EditorContextKeys.comparingMovedCode,
|
|
126
|
-
f1: false,
|
|
127
|
-
category: diffEditorCategory,
|
|
128
|
-
keybinding: {
|
|
129
|
-
weight: 10000,
|
|
130
|
-
primary: 9 ,
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
runEditorCommand(accessor, editor, ...args) {
|
|
135
|
-
const diffEditor = findFocusedDiffEditor(accessor);
|
|
136
|
-
if (diffEditor instanceof DiffEditorWidget2) {
|
|
137
|
-
diffEditor.exitCompareMove();
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
registerAction2(ExitCompareMove);
|
|
142
|
-
class CollapseAllUnchangedRegions extends EditorAction2 {
|
|
143
|
-
constructor() {
|
|
144
|
-
super({
|
|
145
|
-
id: 'diffEditor.collapseAllUnchangedRegions',
|
|
146
|
-
title: { value: ( localize('collapseAllUnchangedRegions', "Collapse All Unchanged Regions")), original: 'Collapse All Unchanged Regions' },
|
|
147
|
-
icon: Codicon.fold,
|
|
148
|
-
precondition: ( ContextKeyExpr.and(ContextKeyEqualsExpr.create('diffEditorVersion', 2), ( ContextKeyExpr.has('isInDiffEditor')))),
|
|
149
|
-
f1: true,
|
|
150
|
-
category: diffEditorCategory,
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
runEditorCommand(accessor, editor, ...args) {
|
|
154
|
-
const diffEditor = findFocusedDiffEditor(accessor);
|
|
155
|
-
if (diffEditor instanceof DiffEditorWidget2) {
|
|
156
|
-
diffEditor.collapseAllUnchangedRegions();
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
registerAction2(CollapseAllUnchangedRegions);
|
|
161
|
-
class ShowAllUnchangedRegions extends EditorAction2 {
|
|
162
|
-
constructor() {
|
|
163
|
-
super({
|
|
164
|
-
id: 'diffEditor.showAllUnchangedRegions',
|
|
165
|
-
title: { value: ( localize('showAllUnchangedRegions', "Show All Unchanged Regions")), original: 'Show All Unchanged Regions' },
|
|
166
|
-
icon: Codicon.unfold,
|
|
167
|
-
precondition: ( ContextKeyExpr.and(ContextKeyEqualsExpr.create('diffEditorVersion', 2), ( ContextKeyExpr.has('isInDiffEditor')))),
|
|
168
|
-
f1: true,
|
|
169
|
-
category: diffEditorCategory,
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
runEditorCommand(accessor, editor, ...args) {
|
|
173
|
-
const diffEditor = findFocusedDiffEditor(accessor);
|
|
174
|
-
if (diffEditor instanceof DiffEditorWidget2) {
|
|
175
|
-
diffEditor.showAllUnchangedRegions();
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
registerAction2(ShowAllUnchangedRegions);
|
|
180
|
-
export { CollapseAllUnchangedRegions, ExitCompareMove, ShowAllUnchangedRegions, SwitchSide, ToggleCollapseUnchangedRegions, ToggleShowMovedCodeBlocks, ToggleUseInlineViewWhenSpaceIsLimited };
|