@codingame/monaco-vscode-extensions-service-override 25.1.2 → 26.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +7 -0
- package/package.json +3 -3
- package/vscode/src/vs/base/common/console.js +24 -15
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.d.ts +4 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +149 -84
- package/vscode/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.js +20 -12
- package/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.js +38 -21
- package/vscode/src/vs/platform/remote/common/managedSocket.js +7 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.js +5 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.js +5 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadAiSettingsSearch.js +4 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +200 -143
- package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +10 -14
- package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +41 -31
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.d.ts +9 -12
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +168 -115
- package/vscode/src/vs/workbench/api/browser/mainThreadChatCodeMapper.js +11 -13
- package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.d.ts +5 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.js +42 -15
- package/vscode/src/vs/workbench/api/browser/mainThreadChatOutputRenderer.js +8 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.d.ts +4 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +170 -99
- package/vscode/src/vs/workbench/api/browser/mainThreadChatStatus.js +2 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.js +4 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +13 -12
- package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +16 -19
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +127 -70
- package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +80 -26
- package/vscode/src/vs/workbench/api/browser/mainThreadConsole.js +5 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +199 -97
- package/vscode/src/vs/workbench/api/browser/mainThreadDataChannels.js +1 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +88 -73
- package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.js +5 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +16 -12
- package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.js +10 -8
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +14 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +52 -37
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +78 -58
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +5 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +75 -63
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +99 -91
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +93 -55
- package/vscode/src/vs/workbench/api/browser/mainThreadEmbeddings.js +3 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +85 -60
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +49 -45
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +114 -72
- package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.js +4 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.js +1 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.d.ts +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +381 -238
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.d.ts +7 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.js +90 -13
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +81 -58
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguages.js +9 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadLocalization.js +2 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadLogService.js +6 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +12 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.d.ts +3 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.js +162 -97
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +32 -26
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +38 -32
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +48 -46
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +22 -18
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +5 -8
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +35 -21
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +31 -28
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +5 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +47 -23
- package/vscode/src/vs/workbench/api/browser/mainThreadProfileContentHandlers.js +15 -12
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +17 -18
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +6 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +83 -66
- package/vscode/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.js +1 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +250 -92
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +6 -8
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +37 -26
- package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +34 -21
- package/vscode/src/vs/workbench/api/browser/mainThreadShare.js +3 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadSpeech.js +19 -14
- package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +41 -16
- package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +18 -17
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +145 -145
- package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +19 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +176 -80
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.js +52 -21
- package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +26 -24
- package/vscode/src/vs/workbench/api/browser/mainThreadTheming.js +1 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.js +5 -8
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.d.ts +4 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +106 -46
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +83 -65
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +20 -20
- package/vscode/src/vs/workbench/api/browser/mainThreadUrls.js +14 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.js +17 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +49 -38
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.js +10 -13
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +38 -27
- package/vscode/src/vs/workbench/api/browser/mainThreadWindow.js +5 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.d.ts +4 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +73 -43
- package/vscode/src/vs/workbench/api/common/shared/dataTransferCache.js +2 -2
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +17 -10
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +17 -11
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +107 -80
- package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js +336 -175
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +126 -71
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +76 -54
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.js +1 -2
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +2 -0
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +343 -192
- package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +5 -3
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.d.ts +0 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +75 -68
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +135 -36
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +22 -18
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +14 -12
- package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.js +21 -9
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +48 -25
- package/vscode/src/vs/workbench/services/themes/browser/cssExtensionPoint.d.ts +24 -0
- package/vscode/src/vs/workbench/services/themes/browser/cssExtensionPoint.js +300 -0
|
@@ -35,9 +35,8 @@ class MainThreadTextEditorProperties {
|
|
|
35
35
|
if (model.isDisposed()) {
|
|
36
36
|
if (previousProperties) {
|
|
37
37
|
return previousProperties.options;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
throw ( new Error('No valid properties'));
|
|
38
|
+
} else {
|
|
39
|
+
throw ( new Error("No valid properties"));
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
let cursorStyle;
|
|
@@ -47,12 +46,10 @@ class MainThreadTextEditorProperties {
|
|
|
47
46
|
const lineNumbersOpts = options.get(EditorOption.lineNumbers);
|
|
48
47
|
cursorStyle = options.get(EditorOption.cursorStyle);
|
|
49
48
|
lineNumbers = lineNumbersOpts.renderType;
|
|
50
|
-
}
|
|
51
|
-
else if (previousProperties) {
|
|
49
|
+
} else if (previousProperties) {
|
|
52
50
|
cursorStyle = previousProperties.options.cursorStyle;
|
|
53
51
|
lineNumbers = previousProperties.options.lineNumbers;
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
52
|
+
} else {
|
|
56
53
|
cursorStyle = TextEditorCursorStyle.Line;
|
|
57
54
|
lineNumbers = RenderLineNumbersType.On;
|
|
58
55
|
}
|
|
@@ -86,7 +83,7 @@ class MainThreadTextEditorProperties {
|
|
|
86
83
|
if (!oldProps || !MainThreadTextEditorProperties._selectionsEqual(oldProps.selections, this.selections)) {
|
|
87
84
|
delta.selections = {
|
|
88
85
|
selections: this.selections,
|
|
89
|
-
source: selectionChangeSource ?? undefined
|
|
86
|
+
source: selectionChangeSource ?? undefined
|
|
90
87
|
};
|
|
91
88
|
}
|
|
92
89
|
if (!oldProps || !MainThreadTextEditorProperties._optionsEqual(oldProps.options, this.options)) {
|
|
@@ -113,15 +110,19 @@ class MainThreadTextEditorProperties {
|
|
|
113
110
|
if (!a && !b) {
|
|
114
111
|
return true;
|
|
115
112
|
}
|
|
116
|
-
return (a.tabSize === b.tabSize
|
|
117
|
-
&& a.indentSize === b.indentSize
|
|
118
|
-
&& a.insertSpaces === b.insertSpaces
|
|
119
|
-
&& a.cursorStyle === b.cursorStyle
|
|
120
|
-
&& a.lineNumbers === b.lineNumbers);
|
|
113
|
+
return (a.tabSize === b.tabSize && a.indentSize === b.indentSize && a.insertSpaces === b.insertSpaces && a.cursorStyle === b.cursorStyle && a.lineNumbers === b.lineNumbers);
|
|
121
114
|
}
|
|
122
115
|
}
|
|
123
116
|
class MainThreadTextEditor {
|
|
124
|
-
constructor(
|
|
117
|
+
constructor(
|
|
118
|
+
id,
|
|
119
|
+
model,
|
|
120
|
+
codeEditor,
|
|
121
|
+
focusTracker,
|
|
122
|
+
mainThreadDocuments,
|
|
123
|
+
modelService,
|
|
124
|
+
clipboardService
|
|
125
|
+
) {
|
|
125
126
|
this._modelListeners = ( new DisposableStore());
|
|
126
127
|
this._codeEditorListeners = ( new DisposableStore());
|
|
127
128
|
this._id = id;
|
|
@@ -133,7 +134,7 @@ class MainThreadTextEditor {
|
|
|
133
134
|
this._modelService = modelService;
|
|
134
135
|
this._clipboardService = clipboardService;
|
|
135
136
|
this._onPropertiesChanged = ( new Emitter());
|
|
136
|
-
this._modelListeners.add(this._model.onDidChangeOptions(
|
|
137
|
+
this._modelListeners.add(this._model.onDidChangeOptions(e => {
|
|
137
138
|
this._updatePropertiesNow(null);
|
|
138
139
|
}));
|
|
139
140
|
this.setCodeEditor(codeEditor);
|
|
@@ -145,7 +146,10 @@ class MainThreadTextEditor {
|
|
|
145
146
|
this._codeEditorListeners.dispose();
|
|
146
147
|
}
|
|
147
148
|
_updatePropertiesNow(selectionChangeSource) {
|
|
148
|
-
this._setProperties(
|
|
149
|
+
this._setProperties(
|
|
150
|
+
MainThreadTextEditorProperties.readFromEditor(this._properties, this._model, this._codeEditor),
|
|
151
|
+
selectionChangeSource
|
|
152
|
+
);
|
|
149
153
|
}
|
|
150
154
|
_setProperties(newProperties, selectionChangeSource) {
|
|
151
155
|
const delta = newProperties.generateDelta(this._properties, selectionChangeSource);
|
|
@@ -183,7 +187,7 @@ class MainThreadTextEditor {
|
|
|
183
187
|
this._focusTracker.onLostFocus();
|
|
184
188
|
}));
|
|
185
189
|
let nextSelectionChangeSource = null;
|
|
186
|
-
this._codeEditorListeners.add(this._mainThreadDocuments.onIsCaughtUpWithContentChanges(
|
|
190
|
+
this._codeEditorListeners.add(this._mainThreadDocuments.onIsCaughtUpWithContentChanges(uri => {
|
|
187
191
|
if (( uri.toString()) === ( this._model.uri.toString())) {
|
|
188
192
|
const selectionChangeSource = nextSelectionChangeSource;
|
|
189
193
|
nextSelectionChangeSource = null;
|
|
@@ -193,22 +197,21 @@ class MainThreadTextEditor {
|
|
|
193
197
|
const isValidCodeEditor = () => {
|
|
194
198
|
return (this._codeEditor && this._codeEditor.getModel() === this._model);
|
|
195
199
|
};
|
|
196
|
-
const updateProperties =
|
|
200
|
+
const updateProperties = selectionChangeSource => {
|
|
197
201
|
if (this._mainThreadDocuments.isCaughtUpWithContentChanges(this._model.uri)) {
|
|
198
202
|
nextSelectionChangeSource = null;
|
|
199
203
|
this._updatePropertiesNow(selectionChangeSource);
|
|
200
|
-
}
|
|
201
|
-
else {
|
|
204
|
+
} else {
|
|
202
205
|
nextSelectionChangeSource = selectionChangeSource;
|
|
203
206
|
}
|
|
204
207
|
};
|
|
205
|
-
this._codeEditorListeners.add(this._codeEditor.onDidChangeCursorSelection(
|
|
208
|
+
this._codeEditorListeners.add(this._codeEditor.onDidChangeCursorSelection(e => {
|
|
206
209
|
if (!isValidCodeEditor()) {
|
|
207
210
|
return;
|
|
208
211
|
}
|
|
209
212
|
updateProperties(e.source);
|
|
210
213
|
}));
|
|
211
|
-
this._codeEditorListeners.add(this._codeEditor.onDidChangeConfiguration(
|
|
214
|
+
this._codeEditorListeners.add(this._codeEditor.onDidChangeConfiguration(e => {
|
|
212
215
|
if (!isValidCodeEditor()) {
|
|
213
216
|
return;
|
|
214
217
|
}
|
|
@@ -247,27 +250,31 @@ class MainThreadTextEditor {
|
|
|
247
250
|
this._setProperties(( new MainThreadTextEditorProperties(newSelections, this._properties.options, this._properties.visibleRanges)), null);
|
|
248
251
|
}
|
|
249
252
|
_setIndentConfiguration(newConfiguration) {
|
|
250
|
-
const creationOpts = this._modelService.getCreationOptions(
|
|
251
|
-
|
|
253
|
+
const creationOpts = this._modelService.getCreationOptions(
|
|
254
|
+
this._model.getLanguageId(),
|
|
255
|
+
this._model.uri,
|
|
256
|
+
this._model.isForSimpleWidget
|
|
257
|
+
);
|
|
258
|
+
if (newConfiguration.tabSize === "auto" || newConfiguration.insertSpaces === "auto") {
|
|
252
259
|
let insertSpaces = creationOpts.insertSpaces;
|
|
253
260
|
let tabSize = creationOpts.tabSize;
|
|
254
|
-
if (newConfiguration.insertSpaces !==
|
|
261
|
+
if (newConfiguration.insertSpaces !== "auto" && typeof newConfiguration.insertSpaces !== "undefined") {
|
|
255
262
|
insertSpaces = newConfiguration.insertSpaces;
|
|
256
263
|
}
|
|
257
|
-
if (newConfiguration.tabSize !==
|
|
264
|
+
if (newConfiguration.tabSize !== "auto" && typeof newConfiguration.tabSize !== "undefined") {
|
|
258
265
|
tabSize = newConfiguration.tabSize;
|
|
259
266
|
}
|
|
260
267
|
this._model.detectIndentation(insertSpaces, tabSize);
|
|
261
268
|
return;
|
|
262
269
|
}
|
|
263
270
|
const newOpts = {};
|
|
264
|
-
if (typeof newConfiguration.insertSpaces !==
|
|
271
|
+
if (typeof newConfiguration.insertSpaces !== "undefined") {
|
|
265
272
|
newOpts.insertSpaces = newConfiguration.insertSpaces;
|
|
266
273
|
}
|
|
267
|
-
if (typeof newConfiguration.tabSize !==
|
|
274
|
+
if (typeof newConfiguration.tabSize !== "undefined") {
|
|
268
275
|
newOpts.tabSize = newConfiguration.tabSize;
|
|
269
276
|
}
|
|
270
|
-
if (typeof newConfiguration.indentSize !==
|
|
277
|
+
if (typeof newConfiguration.indentSize !== "undefined") {
|
|
271
278
|
newOpts.indentSize = newConfiguration.indentSize;
|
|
272
279
|
}
|
|
273
280
|
this._model.updateOptions(newOpts);
|
|
@@ -283,20 +290,20 @@ class MainThreadTextEditor {
|
|
|
283
290
|
cursorStyle: newCursorStyle
|
|
284
291
|
});
|
|
285
292
|
}
|
|
286
|
-
if (typeof newConfiguration.lineNumbers !==
|
|
293
|
+
if (typeof newConfiguration.lineNumbers !== "undefined") {
|
|
287
294
|
let lineNumbers;
|
|
288
295
|
switch (newConfiguration.lineNumbers) {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
296
|
+
case RenderLineNumbersType.On:
|
|
297
|
+
lineNumbers = "on";
|
|
298
|
+
break;
|
|
299
|
+
case RenderLineNumbersType.Relative:
|
|
300
|
+
lineNumbers = "relative";
|
|
301
|
+
break;
|
|
302
|
+
case RenderLineNumbersType.Interval:
|
|
303
|
+
lineNumbers = "interval";
|
|
304
|
+
break;
|
|
305
|
+
default:
|
|
306
|
+
lineNumbers = "off";
|
|
300
307
|
}
|
|
301
308
|
this._codeEditor.updateOptions({
|
|
302
309
|
lineNumbers: lineNumbers
|
|
@@ -307,7 +314,7 @@ class MainThreadTextEditor {
|
|
|
307
314
|
if (!this._codeEditor) {
|
|
308
315
|
return;
|
|
309
316
|
}
|
|
310
|
-
this._codeEditor.setDecorationsByType(
|
|
317
|
+
this._codeEditor.setDecorationsByType("exthost-api", key, ranges);
|
|
311
318
|
}
|
|
312
319
|
setDecorationsFast(key, _ranges) {
|
|
313
320
|
if (!this._codeEditor) {
|
|
@@ -324,21 +331,21 @@ class MainThreadTextEditor {
|
|
|
324
331
|
return;
|
|
325
332
|
}
|
|
326
333
|
switch (revealType) {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
334
|
+
case TextEditorRevealType.Default:
|
|
335
|
+
this._codeEditor.revealRange(range, ScrollType.Smooth);
|
|
336
|
+
break;
|
|
337
|
+
case TextEditorRevealType.InCenter:
|
|
338
|
+
this._codeEditor.revealRangeInCenter(range, ScrollType.Smooth);
|
|
339
|
+
break;
|
|
340
|
+
case TextEditorRevealType.InCenterIfOutsideViewport:
|
|
341
|
+
this._codeEditor.revealRangeInCenterIfOutsideViewport(range, ScrollType.Smooth);
|
|
342
|
+
break;
|
|
343
|
+
case TextEditorRevealType.AtTop:
|
|
344
|
+
this._codeEditor.revealRangeAtTop(range, ScrollType.Smooth);
|
|
345
|
+
break;
|
|
346
|
+
default:
|
|
347
|
+
console.warn(`Unknown revealType: ${revealType}`);
|
|
348
|
+
break;
|
|
342
349
|
}
|
|
343
350
|
}
|
|
344
351
|
isFocused() {
|
|
@@ -360,10 +367,10 @@ class MainThreadTextEditor {
|
|
|
360
367
|
if (!this._codeEditor) {
|
|
361
368
|
return false;
|
|
362
369
|
}
|
|
363
|
-
if (typeof opts.setEndOfLine !==
|
|
370
|
+
if (typeof opts.setEndOfLine !== "undefined") {
|
|
364
371
|
this._model.pushEOL(opts.setEndOfLine);
|
|
365
372
|
}
|
|
366
|
-
const transformedEdits = ( edits.map(
|
|
373
|
+
const transformedEdits = ( edits.map(edit => {
|
|
367
374
|
return {
|
|
368
375
|
range: Range.lift(edit.range),
|
|
369
376
|
text: edit.text,
|
|
@@ -373,7 +380,7 @@ class MainThreadTextEditor {
|
|
|
373
380
|
if (opts.undoStopBefore) {
|
|
374
381
|
this._codeEditor.pushUndoStop();
|
|
375
382
|
}
|
|
376
|
-
this._codeEditor.executeEdits(
|
|
383
|
+
this._codeEditor.executeEdits("MainThreadTextEditor", transformedEdits);
|
|
377
384
|
if (opts.undoStopAfter) {
|
|
378
385
|
this._codeEditor.pushUndoStop();
|
|
379
386
|
}
|
|
@@ -400,10 +407,15 @@ class MainThreadTextEditor {
|
|
|
400
407
|
return false;
|
|
401
408
|
}
|
|
402
409
|
this._codeEditor.focus();
|
|
403
|
-
const edits = ( ranges.map(range => ({
|
|
410
|
+
const edits = ( ranges.map(range => ({
|
|
411
|
+
range: Range.lift(range),
|
|
412
|
+
template
|
|
413
|
+
})));
|
|
404
414
|
snippetController.apply(edits, {
|
|
405
|
-
overwriteBefore: 0,
|
|
406
|
-
|
|
415
|
+
overwriteBefore: 0,
|
|
416
|
+
overwriteAfter: 0,
|
|
417
|
+
undoStopBefore: opts.undoStopBefore,
|
|
418
|
+
undoStopAfter: opts.undoStopAfter,
|
|
407
419
|
adjustWhitespace: !opts.keepWhitespace,
|
|
408
420
|
clipboardText
|
|
409
421
|
});
|
|
@@ -28,7 +28,13 @@ import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench
|
|
|
28
28
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
29
29
|
|
|
30
30
|
let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
31
|
-
constructor(
|
|
31
|
+
constructor(
|
|
32
|
+
extHostContext,
|
|
33
|
+
_editorGroupsService,
|
|
34
|
+
_configurationService,
|
|
35
|
+
_logService,
|
|
36
|
+
editorService
|
|
37
|
+
) {
|
|
32
38
|
this._editorGroupsService = _editorGroupsService;
|
|
33
39
|
this._configurationService = _configurationService;
|
|
34
40
|
this._logService = _logService;
|
|
@@ -38,12 +44,11 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
38
44
|
this._tabInfoLookup = ( new Map());
|
|
39
45
|
this._multiDiffEditorInputListeners = ( new DisposableMap());
|
|
40
46
|
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostEditorTabs));
|
|
41
|
-
this._dispoables.add(editorService.onDidEditorsChange(
|
|
47
|
+
this._dispoables.add(editorService.onDidEditorsChange(event => {
|
|
42
48
|
try {
|
|
43
49
|
this._updateTabsModel(event);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
this._logService.error('Failed to update model, rebuilding');
|
|
50
|
+
} catch {
|
|
51
|
+
this._logService.error("Failed to update model, rebuilding");
|
|
47
52
|
this._createTabsModel();
|
|
48
53
|
}
|
|
49
54
|
}));
|
|
@@ -90,17 +95,15 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
90
95
|
if (editor instanceof SideBySideEditorInput && !(editor instanceof DiffEditorInput)) {
|
|
91
96
|
const primaryResource = editor.primary.resource;
|
|
92
97
|
const secondaryResource = editor.secondary.resource;
|
|
93
|
-
if (editor.primary instanceof AbstractTextResourceEditorInput
|
|
94
|
-
&& editor.secondary instanceof AbstractTextResourceEditorInput
|
|
95
|
-
&& isEqual(primaryResource, secondaryResource)
|
|
96
|
-
&& primaryResource
|
|
97
|
-
&& secondaryResource) {
|
|
98
|
+
if (editor.primary instanceof AbstractTextResourceEditorInput && editor.secondary instanceof AbstractTextResourceEditorInput && isEqual(primaryResource, secondaryResource) && primaryResource && secondaryResource) {
|
|
98
99
|
return {
|
|
99
100
|
kind: TabInputKind.TextInput,
|
|
100
101
|
uri: primaryResource
|
|
101
102
|
};
|
|
102
103
|
}
|
|
103
|
-
return {
|
|
104
|
+
return {
|
|
105
|
+
kind: TabInputKind.UnknownInput
|
|
106
|
+
};
|
|
104
107
|
}
|
|
105
108
|
if (editor instanceof NotebookEditorInput) {
|
|
106
109
|
return {
|
|
@@ -113,7 +116,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
113
116
|
return {
|
|
114
117
|
kind: TabInputKind.CustomEditorInput,
|
|
115
118
|
viewType: editor.viewType,
|
|
116
|
-
uri: editor.resource
|
|
119
|
+
uri: editor.resource
|
|
117
120
|
};
|
|
118
121
|
}
|
|
119
122
|
if (editor instanceof WebviewInput) {
|
|
@@ -153,7 +156,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
153
156
|
}
|
|
154
157
|
if (editor instanceof ChatEditorInput) {
|
|
155
158
|
return {
|
|
156
|
-
kind: TabInputKind.ChatEditorInput
|
|
159
|
+
kind: TabInputKind.ChatEditorInput
|
|
157
160
|
};
|
|
158
161
|
}
|
|
159
162
|
if (editor instanceof MultiDiffEditorInput) {
|
|
@@ -172,15 +175,18 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
172
175
|
diffEditors
|
|
173
176
|
};
|
|
174
177
|
}
|
|
175
|
-
return {
|
|
178
|
+
return {
|
|
179
|
+
kind: TabInputKind.UnknownInput
|
|
180
|
+
};
|
|
176
181
|
}
|
|
177
182
|
_generateTabId(editor, groupId) {
|
|
178
183
|
let resourceString;
|
|
179
|
-
const resource = EditorResourceAccessor.getCanonicalUri(editor, {
|
|
184
|
+
const resource = EditorResourceAccessor.getCanonicalUri(editor, {
|
|
185
|
+
supportSideBySide: SideBySideEditor.BOTH
|
|
186
|
+
});
|
|
180
187
|
if (resource instanceof URI) {
|
|
181
188
|
resourceString = ( resource.toString());
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
189
|
+
} else {
|
|
184
190
|
resourceString = `${resource?.primary?.toString()}-${resource?.secondary?.toString()}`;
|
|
185
191
|
}
|
|
186
192
|
return `${groupId}~${editor.editorId}-${editor.typeId}-${resourceString} `;
|
|
@@ -204,9 +210,8 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
204
210
|
tabDto: tabInfo.tab,
|
|
205
211
|
kind: TabModelOperationKind.TAB_UPDATE
|
|
206
212
|
});
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
this._logService.error('Invalid model for label change, rebuilding');
|
|
213
|
+
} else {
|
|
214
|
+
this._logService.error("Invalid model for label change, rebuilding");
|
|
210
215
|
this._createTabsModel();
|
|
211
216
|
}
|
|
212
217
|
}
|
|
@@ -224,7 +229,11 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
224
229
|
const tabObject = this._buildTabObject(group, editorInput, editorIndex);
|
|
225
230
|
tabs.splice(editorIndex, 0, tabObject);
|
|
226
231
|
const tabId = this._generateTabId(editorInput, groupId);
|
|
227
|
-
this._tabInfoLookup.set(tabId, {
|
|
232
|
+
this._tabInfoLookup.set(tabId, {
|
|
233
|
+
group,
|
|
234
|
+
editorInput,
|
|
235
|
+
tab: tabObject
|
|
236
|
+
});
|
|
228
237
|
if (editorInput instanceof MultiDiffEditorInput) {
|
|
229
238
|
this._multiDiffEditorInputListeners.set(editorInput, Event.fromObservableLight(editorInput.resources)(() => {
|
|
230
239
|
const tabInfo = this._tabInfoLookup.get(tabId);
|
|
@@ -258,7 +267,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
258
267
|
if (removedTab.length === 0) {
|
|
259
268
|
return;
|
|
260
269
|
}
|
|
261
|
-
this._tabInfoLookup.delete(removedTab[0]?.id ??
|
|
270
|
+
this._tabInfoLookup.delete(removedTab[0]?.id ?? "");
|
|
262
271
|
if (removedTab[0]?.input instanceof MultiDiffEditorInput) {
|
|
263
272
|
this._multiDiffEditorInputListeners.deleteAndDispose(removedTab[0]?.input);
|
|
264
273
|
}
|
|
@@ -287,7 +296,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
287
296
|
const tabId = this._generateTabId(editor, groupId);
|
|
288
297
|
const tabInfo = this._tabInfoLookup.get(tabId);
|
|
289
298
|
if (!tabInfo) {
|
|
290
|
-
this._logService.error(
|
|
299
|
+
this._logService.error("Invalid model for dirty change, rebuilding");
|
|
291
300
|
this._createTabsModel();
|
|
292
301
|
return;
|
|
293
302
|
}
|
|
@@ -305,7 +314,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
305
314
|
const group = tabInfo?.group;
|
|
306
315
|
const tab = tabInfo?.tab;
|
|
307
316
|
if (!group || !tab) {
|
|
308
|
-
this._logService.error(
|
|
317
|
+
this._logService.error("Invalid model for sticky change, rebuilding");
|
|
309
318
|
this._createTabsModel();
|
|
310
319
|
return;
|
|
311
320
|
}
|
|
@@ -323,7 +332,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
323
332
|
const group = tabInfo?.group;
|
|
324
333
|
const tab = tabInfo?.tab;
|
|
325
334
|
if (!group || !tab) {
|
|
326
|
-
this._logService.error(
|
|
335
|
+
this._logService.error("Invalid model for sticky change, rebuilding");
|
|
327
336
|
this._createTabsModel();
|
|
328
337
|
return;
|
|
329
338
|
}
|
|
@@ -338,7 +347,7 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
338
347
|
_onDidTabMove(groupId, editorIndex, oldEditorIndex, editor) {
|
|
339
348
|
const tabs = this._groupLookup.get(groupId)?.tabs;
|
|
340
349
|
if (!tabs) {
|
|
341
|
-
this._logService.error(
|
|
350
|
+
this._logService.error("Invalid model for move change, rebuilding");
|
|
342
351
|
this._createTabsModel();
|
|
343
352
|
return;
|
|
344
353
|
}
|
|
@@ -390,58 +399,57 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
390
399
|
const event = changeEvent.event;
|
|
391
400
|
const groupId = changeEvent.groupId;
|
|
392
401
|
switch (event.kind) {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
break;
|
|
397
|
-
}
|
|
398
|
-
else {
|
|
399
|
-
return;
|
|
400
|
-
}
|
|
401
|
-
case GroupModelChangeKind.EDITOR_LABEL:
|
|
402
|
-
if (event.editor !== undefined && event.editorIndex !== undefined) {
|
|
403
|
-
this._onDidTabLabelChange(groupId, event.editor, event.editorIndex);
|
|
404
|
-
break;
|
|
405
|
-
}
|
|
406
|
-
case GroupModelChangeKind.EDITOR_OPEN:
|
|
407
|
-
if (event.editor !== undefined && event.editorIndex !== undefined) {
|
|
408
|
-
this._onDidTabOpen(groupId, event.editor, event.editorIndex);
|
|
409
|
-
break;
|
|
410
|
-
}
|
|
411
|
-
case GroupModelChangeKind.EDITOR_CLOSE:
|
|
412
|
-
if (event.editorIndex !== undefined) {
|
|
413
|
-
this._onDidTabClose(groupId, event.editorIndex);
|
|
414
|
-
break;
|
|
415
|
-
}
|
|
416
|
-
case GroupModelChangeKind.EDITOR_ACTIVE:
|
|
417
|
-
if (event.editorIndex !== undefined) {
|
|
418
|
-
this._onDidTabActiveChange(groupId, event.editorIndex);
|
|
419
|
-
break;
|
|
420
|
-
}
|
|
421
|
-
case GroupModelChangeKind.EDITOR_DIRTY:
|
|
422
|
-
if (event.editorIndex !== undefined && event.editor !== undefined) {
|
|
423
|
-
this._onDidTabDirty(groupId, event.editorIndex, event.editor);
|
|
424
|
-
break;
|
|
425
|
-
}
|
|
426
|
-
case GroupModelChangeKind.EDITOR_STICKY:
|
|
427
|
-
if (event.editorIndex !== undefined && event.editor !== undefined) {
|
|
428
|
-
this._onDidTabPinChange(groupId, event.editorIndex, event.editor);
|
|
429
|
-
break;
|
|
430
|
-
}
|
|
431
|
-
case GroupModelChangeKind.EDITOR_PIN:
|
|
432
|
-
if (event.editorIndex !== undefined && event.editor !== undefined) {
|
|
433
|
-
this._onDidTabPreviewChange(groupId, event.editorIndex, event.editor);
|
|
434
|
-
break;
|
|
435
|
-
}
|
|
436
|
-
case GroupModelChangeKind.EDITOR_TRANSIENT:
|
|
402
|
+
case GroupModelChangeKind.GROUP_ACTIVE:
|
|
403
|
+
if (groupId === this._editorGroupsService.activeGroup.id) {
|
|
404
|
+
this._onDidGroupActivate();
|
|
437
405
|
break;
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
406
|
+
} else {
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
case GroupModelChangeKind.EDITOR_LABEL:
|
|
410
|
+
if (event.editor !== undefined && event.editorIndex !== undefined) {
|
|
411
|
+
this._onDidTabLabelChange(groupId, event.editor, event.editorIndex);
|
|
412
|
+
break;
|
|
413
|
+
}
|
|
414
|
+
case GroupModelChangeKind.EDITOR_OPEN:
|
|
415
|
+
if (event.editor !== undefined && event.editorIndex !== undefined) {
|
|
416
|
+
this._onDidTabOpen(groupId, event.editor, event.editorIndex);
|
|
417
|
+
break;
|
|
418
|
+
}
|
|
419
|
+
case GroupModelChangeKind.EDITOR_CLOSE:
|
|
420
|
+
if (event.editorIndex !== undefined) {
|
|
421
|
+
this._onDidTabClose(groupId, event.editorIndex);
|
|
422
|
+
break;
|
|
423
|
+
}
|
|
424
|
+
case GroupModelChangeKind.EDITOR_ACTIVE:
|
|
425
|
+
if (event.editorIndex !== undefined) {
|
|
426
|
+
this._onDidTabActiveChange(groupId, event.editorIndex);
|
|
427
|
+
break;
|
|
428
|
+
}
|
|
429
|
+
case GroupModelChangeKind.EDITOR_DIRTY:
|
|
430
|
+
if (event.editorIndex !== undefined && event.editor !== undefined) {
|
|
431
|
+
this._onDidTabDirty(groupId, event.editorIndex, event.editor);
|
|
432
|
+
break;
|
|
433
|
+
}
|
|
434
|
+
case GroupModelChangeKind.EDITOR_STICKY:
|
|
435
|
+
if (event.editorIndex !== undefined && event.editor !== undefined) {
|
|
436
|
+
this._onDidTabPinChange(groupId, event.editorIndex, event.editor);
|
|
437
|
+
break;
|
|
438
|
+
}
|
|
439
|
+
case GroupModelChangeKind.EDITOR_PIN:
|
|
440
|
+
if (event.editorIndex !== undefined && event.editor !== undefined) {
|
|
441
|
+
this._onDidTabPreviewChange(groupId, event.editorIndex, event.editor);
|
|
442
|
+
break;
|
|
443
|
+
}
|
|
444
|
+
case GroupModelChangeKind.EDITOR_TRANSIENT:
|
|
445
|
+
break;
|
|
446
|
+
case GroupModelChangeKind.EDITOR_MOVE:
|
|
447
|
+
if (isGroupEditorMoveEvent(event) && event.editor && event.editorIndex !== undefined && event.oldEditorIndex !== undefined) {
|
|
448
|
+
this._onDidTabMove(groupId, event.editorIndex, event.oldEditorIndex, event.editor);
|
|
449
|
+
break;
|
|
450
|
+
}
|
|
451
|
+
default:
|
|
452
|
+
this._createTabsModel();
|
|
445
453
|
}
|
|
446
454
|
}
|
|
447
455
|
$moveTab(tabId, index, viewColumn, preserveFocus) {
|
|
@@ -461,9 +469,11 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
461
469
|
if (viewColumn === SIDE_GROUP) {
|
|
462
470
|
direction = preferredSideBySideGroupDirection(this._configurationService);
|
|
463
471
|
}
|
|
464
|
-
targetGroup = this._editorGroupsService.addGroup(
|
|
465
|
-
|
|
466
|
-
|
|
472
|
+
targetGroup = this._editorGroupsService.addGroup(
|
|
473
|
+
this._editorGroupsService.groups[this._editorGroupsService.groups.length - 1],
|
|
474
|
+
direction
|
|
475
|
+
);
|
|
476
|
+
} else {
|
|
467
477
|
targetGroup = this._editorGroupsService.getGroup(groupId);
|
|
468
478
|
}
|
|
469
479
|
if (!targetGroup) {
|
|
@@ -476,7 +486,10 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
476
486
|
if (!editorInput) {
|
|
477
487
|
return;
|
|
478
488
|
}
|
|
479
|
-
sourceGroup.moveEditor(editorInput, targetGroup, {
|
|
489
|
+
sourceGroup.moveEditor(editorInput, targetGroup, {
|
|
490
|
+
index,
|
|
491
|
+
preserveFocus
|
|
492
|
+
});
|
|
480
493
|
return;
|
|
481
494
|
}
|
|
482
495
|
async $closeTab(tabIds, preserveFocus) {
|
|
@@ -492,14 +505,15 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
492
505
|
const groupEditors = groups.get(group);
|
|
493
506
|
if (!groupEditors) {
|
|
494
507
|
groups.set(group, [editorTab]);
|
|
495
|
-
}
|
|
496
|
-
else {
|
|
508
|
+
} else {
|
|
497
509
|
groupEditors.push(editorTab);
|
|
498
510
|
}
|
|
499
511
|
}
|
|
500
512
|
const results = [];
|
|
501
513
|
for (const [group, editors] of groups) {
|
|
502
|
-
results.push(await group.closeEditors(editors, {
|
|
514
|
+
results.push(await group.closeEditors(editors, {
|
|
515
|
+
preserveFocus
|
|
516
|
+
}));
|
|
503
517
|
}
|
|
504
518
|
return results.every(result => result);
|
|
505
519
|
}
|
|
@@ -517,12 +531,6 @@ let MainThreadEditorTabs = class MainThreadEditorTabs {
|
|
|
517
531
|
return groupCloseResults.every(result => result);
|
|
518
532
|
}
|
|
519
533
|
};
|
|
520
|
-
MainThreadEditorTabs = __decorate([
|
|
521
|
-
extHostNamedCustomer(MainContext.MainThreadEditorTabs),
|
|
522
|
-
( __param(1, IEditorGroupsService)),
|
|
523
|
-
( __param(2, IConfigurationService)),
|
|
524
|
-
( __param(3, ILogService)),
|
|
525
|
-
( __param(4, IEditorService))
|
|
526
|
-
], MainThreadEditorTabs);
|
|
534
|
+
MainThreadEditorTabs = __decorate([extHostNamedCustomer(MainContext.MainThreadEditorTabs), ( __param(1, IEditorGroupsService)), ( __param(2, IConfigurationService)), ( __param(3, ILogService)), ( __param(4, IEditorService))], MainThreadEditorTabs);
|
|
527
535
|
|
|
528
536
|
export { MainThreadEditorTabs };
|