@codingame/monaco-vscode-extensions-service-override 25.1.2 → 26.0.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/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
|
@@ -38,28 +38,30 @@ let MainThreadNotebooks = class MainThreadNotebooks {
|
|
|
38
38
|
const disposables = ( new DisposableStore());
|
|
39
39
|
disposables.add(this._notebookService.registerNotebookSerializer(viewType, extension, {
|
|
40
40
|
options,
|
|
41
|
-
dataToNotebook: async
|
|
41
|
+
dataToNotebook: async data => {
|
|
42
42
|
const sw = ( new StopWatch());
|
|
43
43
|
let result;
|
|
44
|
-
if (data.byteLength === 0 && viewType ===
|
|
45
|
-
result = NotebookDto.fromNotebookDataDto({
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
if (data.byteLength === 0 && viewType === "interactive") {
|
|
45
|
+
result = NotebookDto.fromNotebookDataDto({
|
|
46
|
+
cells: [],
|
|
47
|
+
metadata: {}
|
|
48
|
+
});
|
|
49
|
+
} else {
|
|
48
50
|
const dto = await this._proxy.$dataToNotebook(handle, data, CancellationToken.None);
|
|
49
51
|
result = NotebookDto.fromNotebookDataDto(dto.value);
|
|
50
52
|
}
|
|
51
53
|
this._logService.trace(`[NotebookSerializer] dataToNotebook DONE after ${sw.elapsed()}ms`, {
|
|
52
54
|
viewType,
|
|
53
|
-
extensionId: extension.id.value
|
|
55
|
+
extensionId: extension.id.value
|
|
54
56
|
});
|
|
55
57
|
return result;
|
|
56
58
|
},
|
|
57
|
-
notebookToData:
|
|
59
|
+
notebookToData: data => {
|
|
58
60
|
const sw = ( new StopWatch());
|
|
59
61
|
const result = this._proxy.$notebookToData(handle, ( new SerializableObjectWithBuffers(NotebookDto.toNotebookDataDto(data))), CancellationToken.None);
|
|
60
62
|
this._logService.trace(`[NotebookSerializer] notebookToData DONE after ${sw.elapsed()}`, {
|
|
61
63
|
viewType,
|
|
62
|
-
extensionId: extension.id.value
|
|
64
|
+
extensionId: extension.id.value
|
|
63
65
|
});
|
|
64
66
|
return result;
|
|
65
67
|
},
|
|
@@ -77,21 +79,27 @@ let MainThreadNotebooks = class MainThreadNotebooks {
|
|
|
77
79
|
searchInNotebooks: async (textQuery, token, allPriorityInfo) => {
|
|
78
80
|
const contributedType = this._notebookService.getContributedNotebookType(viewType);
|
|
79
81
|
if (!contributedType) {
|
|
80
|
-
return {
|
|
82
|
+
return {
|
|
83
|
+
results: [],
|
|
84
|
+
limitHit: false
|
|
85
|
+
};
|
|
81
86
|
}
|
|
82
87
|
const fileNames = contributedType.selectors;
|
|
83
|
-
const includes = ( fileNames.map(
|
|
88
|
+
const includes = ( fileNames.map(selector => {
|
|
84
89
|
const globPattern = selector.include || selector;
|
|
85
90
|
return ( globPattern.toString());
|
|
86
91
|
}));
|
|
87
92
|
if (!includes.length) {
|
|
88
93
|
return {
|
|
89
|
-
results: [],
|
|
94
|
+
results: [],
|
|
95
|
+
limitHit: false
|
|
90
96
|
};
|
|
91
97
|
}
|
|
92
|
-
const thisPriorityInfo = coalesce([{
|
|
93
|
-
|
|
94
|
-
|
|
98
|
+
const thisPriorityInfo = coalesce([{
|
|
99
|
+
isFromSettings: false,
|
|
100
|
+
filenamePatterns: includes
|
|
101
|
+
}, ...(allPriorityInfo.get(viewType) ?? [])]);
|
|
102
|
+
const otherEditorsPriorityInfo = Array.from(( allPriorityInfo.keys())).flatMap(key => {
|
|
95
103
|
if (key !== viewType) {
|
|
96
104
|
return allPriorityInfo.get(key) ?? [];
|
|
97
105
|
}
|
|
@@ -105,16 +113,19 @@ let MainThreadNotebooks = class MainThreadNotebooks {
|
|
|
105
113
|
cellResults: ( result.cellResults.map(e => revive(e)))
|
|
106
114
|
};
|
|
107
115
|
}));
|
|
108
|
-
return {
|
|
116
|
+
return {
|
|
117
|
+
results: revivedResults,
|
|
118
|
+
limitHit: searchComplete.limitHit
|
|
119
|
+
};
|
|
109
120
|
}
|
|
110
121
|
}));
|
|
111
122
|
if (data) {
|
|
112
123
|
disposables.add(this._notebookService.registerContributedNotebookType(viewType, data));
|
|
113
124
|
}
|
|
114
125
|
this._notebookSerializer.set(handle, disposables);
|
|
115
|
-
this._logService.trace(
|
|
126
|
+
this._logService.trace("[NotebookSerializer] registered notebook serializer", {
|
|
116
127
|
viewType,
|
|
117
|
-
extensionId: extension.id.value
|
|
128
|
+
extensionId: extension.id.value
|
|
118
129
|
});
|
|
119
130
|
}
|
|
120
131
|
$unregisterNotebookSerializer(handle) {
|
|
@@ -143,7 +154,7 @@ let MainThreadNotebooks = class MainThreadNotebooks {
|
|
|
143
154
|
},
|
|
144
155
|
viewType
|
|
145
156
|
};
|
|
146
|
-
if (typeof eventHandle ===
|
|
157
|
+
if (typeof eventHandle === "number") {
|
|
147
158
|
const emitter = ( new Emitter());
|
|
148
159
|
this._notebookCellStatusBarRegistrations.set(eventHandle, emitter);
|
|
149
160
|
provider.onDidChangeStatusBarItems = emitter.event;
|
|
@@ -152,7 +163,7 @@ let MainThreadNotebooks = class MainThreadNotebooks {
|
|
|
152
163
|
this._notebookCellStatusBarRegistrations.set(handle, disposable);
|
|
153
164
|
}
|
|
154
165
|
async $unregisterNotebookCellStatusBarItemProvider(handle, eventHandle) {
|
|
155
|
-
const unregisterThing =
|
|
166
|
+
const unregisterThing = handle => {
|
|
156
167
|
const entry = this._notebookCellStatusBarRegistrations.get(handle);
|
|
157
168
|
if (entry) {
|
|
158
169
|
this._notebookCellStatusBarRegistrations.get(handle)?.dispose();
|
|
@@ -160,21 +171,16 @@ let MainThreadNotebooks = class MainThreadNotebooks {
|
|
|
160
171
|
}
|
|
161
172
|
};
|
|
162
173
|
unregisterThing(handle);
|
|
163
|
-
if (typeof eventHandle ===
|
|
174
|
+
if (typeof eventHandle === "number") {
|
|
164
175
|
unregisterThing(eventHandle);
|
|
165
176
|
}
|
|
166
177
|
}
|
|
167
178
|
};
|
|
168
|
-
MainThreadNotebooks = __decorate([
|
|
169
|
-
|
|
170
|
-
( __param(1, INotebookService)),
|
|
171
|
-
( __param(2, INotebookCellStatusBarService)),
|
|
172
|
-
( __param(3, ILogService))
|
|
173
|
-
], MainThreadNotebooks);
|
|
174
|
-
CommandsRegistry.registerCommand('_executeDataToNotebook', async (accessor, ...args) => {
|
|
179
|
+
MainThreadNotebooks = __decorate([extHostNamedCustomer(MainContext.MainThreadNotebook), ( __param(1, INotebookService)), ( __param(2, INotebookCellStatusBarService)), ( __param(3, ILogService))], MainThreadNotebooks);
|
|
180
|
+
CommandsRegistry.registerCommand("_executeDataToNotebook", async (accessor, ...args) => {
|
|
175
181
|
const [notebookType, bytes] = args;
|
|
176
|
-
assertType(typeof notebookType ===
|
|
177
|
-
assertType(bytes instanceof VSBuffer,
|
|
182
|
+
assertType(typeof notebookType === "string", "string");
|
|
183
|
+
assertType(bytes instanceof VSBuffer, "VSBuffer");
|
|
178
184
|
const notebookService = accessor.get(INotebookService);
|
|
179
185
|
const info = await notebookService.withNotebookDataProvider(notebookType);
|
|
180
186
|
if (!(info instanceof SimpleNotebookProviderInfo)) {
|
|
@@ -183,8 +189,8 @@ CommandsRegistry.registerCommand('_executeDataToNotebook', async (accessor, ...a
|
|
|
183
189
|
const dto = await info.serializer.dataToNotebook(bytes);
|
|
184
190
|
return ( new SerializableObjectWithBuffers(NotebookDto.toNotebookDataDto(dto)));
|
|
185
191
|
});
|
|
186
|
-
CommandsRegistry.registerCommand(
|
|
187
|
-
assertType(typeof notebookType ===
|
|
192
|
+
CommandsRegistry.registerCommand("_executeNotebookToData", async (accessor, notebookType, dto) => {
|
|
193
|
+
assertType(typeof notebookType === "string", "string");
|
|
188
194
|
const notebookService = accessor.get(INotebookService);
|
|
189
195
|
const info = await notebookService.withNotebookDataProvider(notebookType);
|
|
190
196
|
if (!(info instanceof SimpleNotebookProviderInfo)) {
|
|
@@ -196,7 +202,7 @@ CommandsRegistry.registerCommand('_executeNotebookToData', async (accessor, note
|
|
|
196
202
|
});
|
|
197
203
|
function isFileOperationError(error) {
|
|
198
204
|
const candidate = error;
|
|
199
|
-
return typeof candidate?.fileOperationResult ===
|
|
205
|
+
return typeof candidate?.fileOperationResult === "number" && typeof candidate?.message === "string";
|
|
200
206
|
}
|
|
201
207
|
|
|
202
208
|
export { MainThreadNotebooks };
|
|
@@ -20,8 +20,12 @@ let MainThreadNotebookDocuments = class MainThreadNotebookDocuments {
|
|
|
20
20
|
this._documentEventListenersMapping = ( new ResourceMap());
|
|
21
21
|
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostNotebookDocuments));
|
|
22
22
|
this._modelReferenceCollection = ( new BoundModelReferenceCollection(this._uriIdentityService.extUri));
|
|
23
|
-
this._disposables.add(this._notebookEditorModelResolverService.onDidChangeDirty(
|
|
24
|
-
|
|
23
|
+
this._disposables.add(this._notebookEditorModelResolverService.onDidChangeDirty(
|
|
24
|
+
model => this._proxy.$acceptDirtyStateChanged(model.resource, model.isDirty())
|
|
25
|
+
));
|
|
26
|
+
this._disposables.add(
|
|
27
|
+
this._notebookEditorModelResolverService.onDidSaveNotebook(e => this._proxy.$acceptModelSaved(e))
|
|
28
|
+
);
|
|
25
29
|
this._disposables.add(_notebookEditorModelResolverService.onWillFailWithConflict(e => {
|
|
26
30
|
this._modelReferenceCollection.remove(e.resource);
|
|
27
31
|
}));
|
|
@@ -41,42 +45,42 @@ let MainThreadNotebookDocuments = class MainThreadNotebookDocuments {
|
|
|
41
45
|
};
|
|
42
46
|
for (const e of event.rawEvents) {
|
|
43
47
|
switch (e.kind) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
48
|
+
case NotebookCellsChangeType.ModelChange:
|
|
49
|
+
eventDto.rawEvents.push({
|
|
50
|
+
kind: e.kind,
|
|
51
|
+
changes: ( e.changes.map(diff => [diff[0], diff[1], ( diff[2].map(cell => NotebookDto.toNotebookCellDto(cell)))]))
|
|
52
|
+
});
|
|
53
|
+
break;
|
|
54
|
+
case NotebookCellsChangeType.Move:
|
|
55
|
+
eventDto.rawEvents.push({
|
|
56
|
+
kind: e.kind,
|
|
57
|
+
index: e.index,
|
|
58
|
+
length: e.length,
|
|
59
|
+
newIdx: e.newIdx
|
|
60
|
+
});
|
|
61
|
+
break;
|
|
62
|
+
case NotebookCellsChangeType.Output:
|
|
63
|
+
eventDto.rawEvents.push({
|
|
64
|
+
kind: e.kind,
|
|
65
|
+
index: e.index,
|
|
66
|
+
outputs: ( e.outputs.map(NotebookDto.toNotebookOutputDto))
|
|
67
|
+
});
|
|
68
|
+
break;
|
|
69
|
+
case NotebookCellsChangeType.OutputItem:
|
|
70
|
+
eventDto.rawEvents.push({
|
|
71
|
+
kind: e.kind,
|
|
72
|
+
index: e.index,
|
|
73
|
+
outputId: e.outputId,
|
|
74
|
+
outputItems: ( e.outputItems.map(NotebookDto.toNotebookOutputItemDto)),
|
|
75
|
+
append: e.append
|
|
76
|
+
});
|
|
77
|
+
break;
|
|
78
|
+
case NotebookCellsChangeType.ChangeCellLanguage:
|
|
79
|
+
case NotebookCellsChangeType.ChangeCellContent:
|
|
80
|
+
case NotebookCellsChangeType.ChangeCellMetadata:
|
|
81
|
+
case NotebookCellsChangeType.ChangeCellInternalMetadata:
|
|
82
|
+
eventDto.rawEvents.push(e);
|
|
83
|
+
break;
|
|
80
84
|
}
|
|
81
85
|
}
|
|
82
86
|
const hasDocumentMetadataChangeEvent = event.rawEvents.find(e => e.kind === NotebookCellsChangeType.ChangeDocumentMetadata);
|
|
@@ -93,7 +97,9 @@ let MainThreadNotebookDocuments = class MainThreadNotebookDocuments {
|
|
|
93
97
|
}
|
|
94
98
|
async $tryCreateNotebook(options) {
|
|
95
99
|
if (options.content) {
|
|
96
|
-
const ref = await this._notebookEditorModelResolverService.resolve({
|
|
100
|
+
const ref = await this._notebookEditorModelResolverService.resolve({
|
|
101
|
+
untitledResource: undefined
|
|
102
|
+
}, options.viewType);
|
|
97
103
|
Event.once(ref.object.notebook.onWillDispose)(() => {
|
|
98
104
|
ref.dispose();
|
|
99
105
|
});
|
|
@@ -103,8 +109,7 @@ let MainThreadNotebookDocuments = class MainThreadNotebookDocuments {
|
|
|
103
109
|
ref.object.notebook.reset(data.cells, data.metadata, ref.object.notebook.transientOptions);
|
|
104
110
|
}
|
|
105
111
|
return ref.object.notebook.uri;
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
112
|
+
} else {
|
|
108
113
|
const notebook = await this._notebookEditorModelResolverService.createUntitledNotebookTextModel(options.viewType);
|
|
109
114
|
return notebook.uri;
|
|
110
115
|
}
|
|
@@ -112,7 +117,7 @@ let MainThreadNotebookDocuments = class MainThreadNotebookDocuments {
|
|
|
112
117
|
async $tryOpenNotebook(uriComponents) {
|
|
113
118
|
const uri = URI.revive(uriComponents);
|
|
114
119
|
const ref = await this._notebookEditorModelResolverService.resolve(uri, undefined);
|
|
115
|
-
if (uriComponents.scheme ===
|
|
120
|
+
if (uriComponents.scheme === "untitled") {
|
|
116
121
|
ref.object.notebook.onWillDispose(() => {
|
|
117
122
|
ref.dispose();
|
|
118
123
|
});
|
|
@@ -128,9 +133,6 @@ let MainThreadNotebookDocuments = class MainThreadNotebookDocuments {
|
|
|
128
133
|
return saveResult;
|
|
129
134
|
}
|
|
130
135
|
};
|
|
131
|
-
MainThreadNotebookDocuments = ( __decorate([
|
|
132
|
-
( __param(1, INotebookEditorModelResolverService)),
|
|
133
|
-
( __param(2, IUriIdentityService))
|
|
134
|
-
], MainThreadNotebookDocuments));
|
|
136
|
+
MainThreadNotebookDocuments = ( __decorate([( __param(1, INotebookEditorModelResolverService)), ( __param(2, IUriIdentityService))], MainThreadNotebookDocuments));
|
|
135
137
|
|
|
136
138
|
export { MainThreadNotebookDocuments };
|
|
@@ -39,9 +39,7 @@ class NotebookAndEditorState {
|
|
|
39
39
|
addedEditors: editorDelta.added,
|
|
40
40
|
removedEditors: ( editorDelta.removed.map(removed => removed.getId())),
|
|
41
41
|
newActiveEditor: newActiveEditor,
|
|
42
|
-
visibleEditors: visibleEditorDelta.added.length === 0 && visibleEditorDelta.removed.length === 0
|
|
43
|
-
? undefined
|
|
44
|
-
: ( [...after.visibleEditors].map(editor => editor[0]))
|
|
42
|
+
visibleEditors: visibleEditorDelta.added.length === 0 && visibleEditorDelta.removed.length === 0 ? undefined : ( [...after.visibleEditors].map(editor => editor[0]))
|
|
45
43
|
};
|
|
46
44
|
}
|
|
47
45
|
constructor(documents, textEditors, activeEditor, visibleEditors) {
|
|
@@ -52,7 +50,15 @@ class NotebookAndEditorState {
|
|
|
52
50
|
}
|
|
53
51
|
}
|
|
54
52
|
let MainThreadNotebooksAndEditors = MainThreadNotebooksAndEditors_1 = class MainThreadNotebooksAndEditors {
|
|
55
|
-
constructor(
|
|
53
|
+
constructor(
|
|
54
|
+
extHostContext,
|
|
55
|
+
instantiationService,
|
|
56
|
+
_notebookService,
|
|
57
|
+
_notebookEditorService,
|
|
58
|
+
_editorService,
|
|
59
|
+
_editorGroupService,
|
|
60
|
+
_logService
|
|
61
|
+
) {
|
|
56
62
|
this._notebookService = _notebookService;
|
|
57
63
|
this._notebookEditorService = _notebookEditorService;
|
|
58
64
|
this._editorService = _editorService;
|
|
@@ -80,7 +86,10 @@ let MainThreadNotebooksAndEditors = MainThreadNotebooksAndEditors_1 = class Main
|
|
|
80
86
|
this._editorListeners.dispose();
|
|
81
87
|
}
|
|
82
88
|
_handleEditorAdd(editor) {
|
|
83
|
-
this._editorListeners.set(editor.getId(), combinedDisposable(
|
|
89
|
+
this._editorListeners.set(editor.getId(), combinedDisposable(
|
|
90
|
+
editor.onDidChangeModel(() => this._updateState()),
|
|
91
|
+
editor.onDidFocusWidget(() => this._updateState(editor))
|
|
92
|
+
));
|
|
84
93
|
this._updateState();
|
|
85
94
|
}
|
|
86
95
|
_handleEditorRemove(editor) {
|
|
@@ -99,12 +108,15 @@ let MainThreadNotebooksAndEditors = MainThreadNotebooksAndEditors_1 = class Main
|
|
|
99
108
|
let activeEditor = null;
|
|
100
109
|
if (activeNotebookEditor) {
|
|
101
110
|
activeEditor = activeNotebookEditor.getId();
|
|
102
|
-
}
|
|
103
|
-
else if (focusedEditor?.textModel) {
|
|
111
|
+
} else if (focusedEditor?.textModel) {
|
|
104
112
|
activeEditor = focusedEditor.getId();
|
|
105
113
|
}
|
|
106
114
|
if (activeEditor && !( editors.has(activeEditor))) {
|
|
107
|
-
this._logService.trace(
|
|
115
|
+
this._logService.trace(
|
|
116
|
+
"MainThreadNotebooksAndEditors#_updateState: active editor is not in editors list",
|
|
117
|
+
activeEditor,
|
|
118
|
+
( editors.keys())
|
|
119
|
+
);
|
|
108
120
|
activeEditor = null;
|
|
109
121
|
}
|
|
110
122
|
for (const editorPane of this._editorService.visibleEditorPanes) {
|
|
@@ -127,7 +139,7 @@ let MainThreadNotebooksAndEditors = MainThreadNotebooksAndEditors_1 = class Main
|
|
|
127
139
|
newActiveEditor: delta.newActiveEditor,
|
|
128
140
|
visibleEditors: delta.visibleEditors,
|
|
129
141
|
addedDocuments: ( delta.addedDocuments.map(MainThreadNotebooksAndEditors_1._asModelAddData)),
|
|
130
|
-
addedEditors: ( delta.addedEditors.map(this._asEditorAddData, this))
|
|
142
|
+
addedEditors: ( delta.addedEditors.map(this._asEditorAddData, this))
|
|
131
143
|
};
|
|
132
144
|
this._proxy.$acceptDocumentAndEditorsDelta(( new SerializableObjectWithBuffers(dto)));
|
|
133
145
|
this._mainThreadEditors.handleEditorsRemoved(delta.removedEditors);
|
|
@@ -177,14 +189,6 @@ let MainThreadNotebooksAndEditors = MainThreadNotebooksAndEditors_1 = class Main
|
|
|
177
189
|
};
|
|
178
190
|
}
|
|
179
191
|
};
|
|
180
|
-
MainThreadNotebooksAndEditors = MainThreadNotebooksAndEditors_1 = __decorate([
|
|
181
|
-
extHostCustomer,
|
|
182
|
-
( __param(1, IInstantiationService)),
|
|
183
|
-
( __param(2, INotebookService)),
|
|
184
|
-
( __param(3, INotebookEditorService)),
|
|
185
|
-
( __param(4, IEditorService)),
|
|
186
|
-
( __param(5, IEditorGroupsService)),
|
|
187
|
-
( __param(6, ILogService))
|
|
188
|
-
], MainThreadNotebooksAndEditors);
|
|
192
|
+
MainThreadNotebooksAndEditors = MainThreadNotebooksAndEditors_1 = __decorate([extHostCustomer, ( __param(1, IInstantiationService)), ( __param(2, INotebookService)), ( __param(3, INotebookEditorService)), ( __param(4, IEditorService)), ( __param(5, IEditorGroupsService)), ( __param(6, ILogService))], MainThreadNotebooksAndEditors);
|
|
189
193
|
|
|
190
194
|
export { MainThreadNotebooksAndEditors };
|
|
@@ -3,7 +3,7 @@ import { CellEditType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/c
|
|
|
3
3
|
import { CellExecutionUpdateType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookExecutionService';
|
|
4
4
|
|
|
5
5
|
var NotebookDto;
|
|
6
|
-
(function
|
|
6
|
+
(function(NotebookDto) {
|
|
7
7
|
function toNotebookOutputItemDto(item) {
|
|
8
8
|
return {
|
|
9
9
|
mime: item.mime,
|
|
@@ -82,7 +82,7 @@ var NotebookDto;
|
|
|
82
82
|
cellKind: cell.cellKind,
|
|
83
83
|
outputs: ( cell.outputs.map(toNotebookOutputDto)),
|
|
84
84
|
metadata: cell.metadata,
|
|
85
|
-
internalMetadata: cell.internalMetadata
|
|
85
|
+
internalMetadata: cell.internalMetadata
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
NotebookDto.toNotebookCellDto = toNotebookCellDto;
|
|
@@ -94,16 +94,14 @@ var NotebookDto;
|
|
|
94
94
|
append: data.append,
|
|
95
95
|
outputs: ( data.outputs.map(fromNotebookOutputDto))
|
|
96
96
|
};
|
|
97
|
-
}
|
|
98
|
-
else if (data.editType === CellExecutionUpdateType.OutputItems) {
|
|
97
|
+
} else if (data.editType === CellExecutionUpdateType.OutputItems) {
|
|
99
98
|
return {
|
|
100
99
|
editType: data.editType,
|
|
101
100
|
append: data.append,
|
|
102
101
|
outputId: data.outputId,
|
|
103
102
|
items: ( data.items.map(fromNotebookOutputItemDto))
|
|
104
103
|
};
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
104
|
+
} else {
|
|
107
105
|
return data;
|
|
108
106
|
}
|
|
109
107
|
}
|
|
@@ -120,8 +118,7 @@ var NotebookDto;
|
|
|
120
118
|
count: edit.count,
|
|
121
119
|
cells: ( edit.cells.map(fromNotebookCellDataDto))
|
|
122
120
|
};
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
121
|
+
} else {
|
|
125
122
|
return edit;
|
|
126
123
|
}
|
|
127
124
|
}
|
|
@@ -22,7 +22,13 @@ class MainThreadNotebook {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
let MainThreadNotebookEditors = class MainThreadNotebookEditors {
|
|
25
|
-
constructor(
|
|
25
|
+
constructor(
|
|
26
|
+
extHostContext,
|
|
27
|
+
_editorService,
|
|
28
|
+
_notebookEditorService,
|
|
29
|
+
_editorGroupService,
|
|
30
|
+
_configurationService
|
|
31
|
+
) {
|
|
26
32
|
this._editorService = _editorService;
|
|
27
33
|
this._notebookEditorService = _notebookEditorService;
|
|
28
34
|
this._editorGroupService = _editorGroupService;
|
|
@@ -42,10 +48,18 @@ let MainThreadNotebookEditors = class MainThreadNotebookEditors {
|
|
|
42
48
|
for (const editor of editors) {
|
|
43
49
|
const editorDisposables = ( new DisposableStore());
|
|
44
50
|
editorDisposables.add(editor.onDidChangeVisibleRanges(() => {
|
|
45
|
-
this._proxy.$acceptEditorPropertiesChanged(editor.getId(), {
|
|
51
|
+
this._proxy.$acceptEditorPropertiesChanged(editor.getId(), {
|
|
52
|
+
visibleRanges: {
|
|
53
|
+
ranges: editor.visibleRanges
|
|
54
|
+
}
|
|
55
|
+
});
|
|
46
56
|
}));
|
|
47
57
|
editorDisposables.add(editor.onDidChangeSelection(() => {
|
|
48
|
-
this._proxy.$acceptEditorPropertiesChanged(editor.getId(), {
|
|
58
|
+
this._proxy.$acceptEditorPropertiesChanged(editor.getId(), {
|
|
59
|
+
selections: {
|
|
60
|
+
selections: editor.getSelections()
|
|
61
|
+
}
|
|
62
|
+
});
|
|
49
63
|
}));
|
|
50
64
|
const wrapper = ( new MainThreadNotebook(editor, editorDisposables));
|
|
51
65
|
this._mainThreadEditors.set(editor.getId(), wrapper);
|
|
@@ -79,12 +93,14 @@ let MainThreadNotebookEditors = class MainThreadNotebookEditors {
|
|
|
79
93
|
label: options.label,
|
|
80
94
|
override: viewType
|
|
81
95
|
};
|
|
82
|
-
const editorPane = await this._editorService.openEditor({
|
|
96
|
+
const editorPane = await this._editorService.openEditor({
|
|
97
|
+
resource: URI.revive(resource),
|
|
98
|
+
options: editorOptions
|
|
99
|
+
}, columnToEditorGroup(this._editorGroupService, this._configurationService, options.position));
|
|
83
100
|
const notebookEditor = getNotebookEditorFromEditorPane(editorPane);
|
|
84
101
|
if (notebookEditor) {
|
|
85
102
|
return notebookEditor.getId();
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
103
|
+
} else {
|
|
88
104
|
throw ( new Error(
|
|
89
105
|
`Notebook Editor creation failure for document ${JSON.stringify(resource)}`
|
|
90
106
|
));
|
|
@@ -104,14 +120,14 @@ let MainThreadNotebookEditors = class MainThreadNotebookEditors {
|
|
|
104
120
|
}
|
|
105
121
|
const cell = notebookEditor.cellAt(range.start);
|
|
106
122
|
switch (revealType) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
123
|
+
case NotebookEditorRevealType.Default:
|
|
124
|
+
return notebookEditor.revealCellRangeInView(range);
|
|
125
|
+
case NotebookEditorRevealType.InCenter:
|
|
126
|
+
return notebookEditor.revealInCenter(cell);
|
|
127
|
+
case NotebookEditorRevealType.InCenterIfOutsideViewport:
|
|
128
|
+
return notebookEditor.revealInCenterIfOutsideViewport(cell);
|
|
129
|
+
case NotebookEditorRevealType.AtTop:
|
|
130
|
+
return notebookEditor.revealInViewAtTop(cell);
|
|
115
131
|
}
|
|
116
132
|
}
|
|
117
133
|
$trySetSelections(id, ranges) {
|
|
@@ -121,15 +137,13 @@ let MainThreadNotebookEditors = class MainThreadNotebookEditors {
|
|
|
121
137
|
}
|
|
122
138
|
editor.setSelections(ranges);
|
|
123
139
|
if (ranges.length) {
|
|
124
|
-
editor.setFocus({
|
|
140
|
+
editor.setFocus({
|
|
141
|
+
start: ranges[0].start,
|
|
142
|
+
end: ranges[0].start + 1
|
|
143
|
+
});
|
|
125
144
|
}
|
|
126
145
|
}
|
|
127
146
|
};
|
|
128
|
-
MainThreadNotebookEditors = ( __decorate([
|
|
129
|
-
( __param(1, IEditorService)),
|
|
130
|
-
( __param(2, INotebookEditorService)),
|
|
131
|
-
( __param(3, IEditorGroupsService)),
|
|
132
|
-
( __param(4, IConfigurationService))
|
|
133
|
-
], MainThreadNotebookEditors));
|
|
147
|
+
MainThreadNotebookEditors = ( __decorate([( __param(1, IEditorService)), ( __param(2, INotebookEditorService)), ( __param(3, IEditorGroupsService)), ( __param(4, IConfigurationService))], MainThreadNotebookEditors));
|
|
134
148
|
|
|
135
149
|
export { MainThreadNotebookEditors };
|