@codingame/monaco-vscode-notebook-service-override 6.0.2 → 7.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/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +52 -37
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +5 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +25 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/media/notebookFind.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +4 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +9 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +245 -88
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +20 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +3 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +13 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +13 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +10 -5
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +10 -8
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.js +0 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +6 -3
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +7 -3
|
@@ -40,11 +40,9 @@ import { BackLayerWebView } from 'vscode/vscode/vs/workbench/contrib/notebook/br
|
|
|
40
40
|
import { NotebookDiffEditorEventDispatcher, NotebookDiffLayoutChangedEvent } from './eventDispatcher.js';
|
|
41
41
|
import { FontMeasurements } from 'vscode/vscode/vs/editor/browser/config/fontMeasurements';
|
|
42
42
|
import { NotebookOptions } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookOptions';
|
|
43
|
-
import { INotebookExecutionStateService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService.service';
|
|
44
43
|
import { cellIndexesToRanges, cellRangesToIndexes } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookRange';
|
|
45
44
|
import { NotebookDiffOverviewRuler } from './notebookDiffOverviewRuler.js';
|
|
46
45
|
import { registerZIndex, ZIndex } from 'vscode/vscode/vs/platform/layout/browser/zIndexRegistry';
|
|
47
|
-
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
48
46
|
|
|
49
47
|
var NotebookTextDiffEditor_1;
|
|
50
48
|
const _moduleId = "vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor";
|
|
@@ -88,7 +86,7 @@ let NotebookTextDiffEditor = class NotebookTextDiffEditor extends EditorPane {
|
|
|
88
86
|
get isDisposed() {
|
|
89
87
|
return this._isDisposed;
|
|
90
88
|
}
|
|
91
|
-
constructor(group, instantiationService, themeService, contextKeyService, notebookEditorWorkerService, configurationService, telemetryService, storageService
|
|
89
|
+
constructor(group, instantiationService, themeService, contextKeyService, notebookEditorWorkerService, configurationService, telemetryService, storageService) {
|
|
92
90
|
super(NotebookTextDiffEditor_1.ID, group, telemetryService, themeService, storageService);
|
|
93
91
|
this.instantiationService = instantiationService;
|
|
94
92
|
this.contextKeyService = contextKeyService;
|
|
@@ -115,13 +113,7 @@ let NotebookTextDiffEditor = class NotebookTextDiffEditor extends EditorPane {
|
|
|
115
113
|
this.onDidChangeSelection = this._onDidChangeSelection.event;
|
|
116
114
|
this._isDisposed = false;
|
|
117
115
|
this.pendingLayouts = ( (new WeakMap()));
|
|
118
|
-
this._notebookOptions = (
|
|
119
|
-
this.window,
|
|
120
|
-
this.configurationService,
|
|
121
|
-
notebookExecutionStateService,
|
|
122
|
-
codeEditorService,
|
|
123
|
-
false
|
|
124
|
-
)));
|
|
116
|
+
this._notebookOptions = instantiationService.createInstance(NotebookOptions, this.window, false, undefined);
|
|
125
117
|
this._register(this._notebookOptions);
|
|
126
118
|
this._revealFirst = true;
|
|
127
119
|
}
|
|
@@ -889,9 +881,7 @@ NotebookTextDiffEditor = NotebookTextDiffEditor_1 = ( (__decorate([
|
|
|
889
881
|
( (__param(4, INotebookEditorWorkerService))),
|
|
890
882
|
( (__param(5, IConfigurationService))),
|
|
891
883
|
( (__param(6, ITelemetryService))),
|
|
892
|
-
( (__param(7, IStorageService)))
|
|
893
|
-
( (__param(8, INotebookExecutionStateService))),
|
|
894
|
-
( (__param(9, ICodeEditorService)))
|
|
884
|
+
( (__param(7, IStorageService)))
|
|
895
885
|
], NotebookTextDiffEditor)));
|
|
896
886
|
registerZIndex(ZIndex.Base, 10, 'notebook-diff-view-viewport-slider');
|
|
897
887
|
registerThemingParticipant((theme, collector) => {
|
|
@@ -43,11 +43,9 @@ import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/c
|
|
|
43
43
|
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
|
|
44
44
|
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
45
45
|
import './services/notebookRendererMessagingServiceImpl.js';
|
|
46
|
-
import 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService';
|
|
47
46
|
import 'vscode/vscode/vs/workbench/services/outline/browser/outline';
|
|
48
47
|
import 'vscode/vscode/vs/editor/contrib/documentSymbols/browser/outlineModel';
|
|
49
48
|
import './viewModel/notebookOutlineEntryFactory.js';
|
|
50
|
-
import 'vscode/vscode/vs/base/common/async';
|
|
51
49
|
import 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
|
|
52
50
|
import './controller/insertCellActions.js';
|
|
53
51
|
import './controller/executeActions.js';
|
|
@@ -143,8 +141,8 @@ class NotebookDiffEditorSerializer {
|
|
|
143
141
|
}
|
|
144
142
|
}
|
|
145
143
|
class NotebookEditorSerializer {
|
|
146
|
-
canSerialize() {
|
|
147
|
-
return
|
|
144
|
+
canSerialize(input) {
|
|
145
|
+
return input.typeId === NotebookEditorInput.ID;
|
|
148
146
|
}
|
|
149
147
|
serialize(input) {
|
|
150
148
|
assertType(input instanceof NotebookEditorInput);
|
|
@@ -507,7 +505,7 @@ let SimpleNotebookWorkingCopyEditorHandler = class SimpleNotebookWorkingCopyEdit
|
|
|
507
505
|
}
|
|
508
506
|
handlesSync(workingCopy) {
|
|
509
507
|
const viewType = this._getViewType(workingCopy);
|
|
510
|
-
if (!viewType || viewType === 'interactive') {
|
|
508
|
+
if (!viewType || viewType === 'interactive' || extname(workingCopy.resource) === '.replNotebook') {
|
|
511
509
|
return undefined;
|
|
512
510
|
}
|
|
513
511
|
return viewType;
|
|
@@ -1030,19 +1028,10 @@ configurationRegistry.registerConfiguration({
|
|
|
1030
1028
|
},
|
|
1031
1029
|
tags: ['notebookLayout']
|
|
1032
1030
|
},
|
|
1033
|
-
[NotebookSetting.findScope]: {
|
|
1034
|
-
markdownDescription: ( localizeWithPath(
|
|
1035
|
-
_moduleId,
|
|
1036
|
-
55,
|
|
1037
|
-
"Enables the user to search within a selection of cells in the notebook. When enabled, the user will see a \"Find in Cell Selection\" icon in the notebook find widget."
|
|
1038
|
-
)),
|
|
1039
|
-
type: 'boolean',
|
|
1040
|
-
default: false,
|
|
1041
|
-
},
|
|
1042
1031
|
[NotebookSetting.remoteSaving]: {
|
|
1043
1032
|
markdownDescription: ( localizeWithPath(
|
|
1044
1033
|
_moduleId,
|
|
1045
|
-
|
|
1034
|
+
55,
|
|
1046
1035
|
"Enables the incremental saving of notebooks between processes and across Remote connections. When enabled, only the changes to the notebook are sent to the extension host, improving performance for large notebooks and slow network connections."
|
|
1047
1036
|
)),
|
|
1048
1037
|
type: 'boolean',
|
|
@@ -1052,28 +1041,28 @@ configurationRegistry.registerConfiguration({
|
|
|
1052
1041
|
[NotebookSetting.scrollToRevealCell]: {
|
|
1053
1042
|
markdownDescription: ( localizeWithPath(
|
|
1054
1043
|
_moduleId,
|
|
1055
|
-
|
|
1044
|
+
56,
|
|
1056
1045
|
"How far to scroll when revealing the next cell upon running {0}.",
|
|
1057
1046
|
'notebook.cell.executeAndSelectBelow'
|
|
1058
1047
|
)),
|
|
1059
1048
|
type: 'string',
|
|
1060
1049
|
enum: ['fullCell', 'firstLine', 'none'],
|
|
1061
1050
|
markdownEnumDescriptions: [
|
|
1062
|
-
( localizeWithPath(_moduleId,
|
|
1063
|
-
( localizeWithPath(_moduleId,
|
|
1064
|
-
( localizeWithPath(_moduleId,
|
|
1051
|
+
( localizeWithPath(_moduleId, 57, 'Scroll to fully reveal the next cell.')),
|
|
1052
|
+
( localizeWithPath(_moduleId, 58, 'Scroll to reveal the first line of the next cell.')),
|
|
1053
|
+
( localizeWithPath(_moduleId, 59, 'Do not scroll.')),
|
|
1065
1054
|
],
|
|
1066
1055
|
default: 'fullCell'
|
|
1067
1056
|
},
|
|
1068
1057
|
[NotebookSetting.cellChat]: {
|
|
1069
|
-
markdownDescription: ( localizeWithPath(_moduleId,
|
|
1058
|
+
markdownDescription: ( localizeWithPath(_moduleId, 60, "Enable experimental floating chat widget in notebooks.")),
|
|
1070
1059
|
type: 'boolean',
|
|
1071
1060
|
default: false
|
|
1072
1061
|
},
|
|
1073
1062
|
[NotebookSetting.cellGenerate]: {
|
|
1074
1063
|
markdownDescription: ( localizeWithPath(
|
|
1075
1064
|
_moduleId,
|
|
1076
|
-
|
|
1065
|
+
61,
|
|
1077
1066
|
"Enable experimental generate action to create code cell with inline chat enabled."
|
|
1078
1067
|
)),
|
|
1079
1068
|
type: 'boolean',
|
|
@@ -1083,21 +1072,21 @@ configurationRegistry.registerConfiguration({
|
|
|
1083
1072
|
[NotebookSetting.notebookVariablesView]: {
|
|
1084
1073
|
markdownDescription: ( localizeWithPath(
|
|
1085
1074
|
_moduleId,
|
|
1086
|
-
|
|
1075
|
+
62,
|
|
1087
1076
|
"Enable the experimental notebook variables view within the debug panel."
|
|
1088
1077
|
)),
|
|
1089
1078
|
type: 'boolean',
|
|
1090
1079
|
default: false
|
|
1091
1080
|
},
|
|
1092
1081
|
[NotebookSetting.cellFailureDiagnostics]: {
|
|
1093
|
-
markdownDescription: ( localizeWithPath(_moduleId,
|
|
1082
|
+
markdownDescription: ( localizeWithPath(_moduleId, 63, "Show available diagnostics for cell failures.")),
|
|
1094
1083
|
type: 'boolean',
|
|
1095
1084
|
default: true
|
|
1096
1085
|
},
|
|
1097
1086
|
[NotebookSetting.outputBackupSizeLimit]: {
|
|
1098
1087
|
markdownDescription: ( localizeWithPath(
|
|
1099
1088
|
_moduleId,
|
|
1100
|
-
|
|
1089
|
+
64,
|
|
1101
1090
|
"The limit of notebook output size in kilobytes (KB) where notebook files will no longer be backed up for hot reload. Use 0 for unlimited."
|
|
1102
1091
|
)),
|
|
1103
1092
|
type: 'number',
|
package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js
CHANGED
|
@@ -10,10 +10,13 @@ import { GroupModelChangeKind } from 'vscode/vscode/vs/workbench/common/editor';
|
|
|
10
10
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
11
11
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
12
12
|
import { InteractiveWindowOpen } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
13
|
+
import { ServiceCollection } from 'vscode/vscode/vs/platform/instantiation/common/serviceCollection';
|
|
14
|
+
import { IEditorProgressService } from 'vscode/vscode/vs/platform/progress/common/progress.service';
|
|
13
15
|
|
|
14
16
|
let NotebookEditorWidgetService = class NotebookEditorWidgetService {
|
|
15
|
-
constructor(editorGroupService, editorService, contextKeyService) {
|
|
17
|
+
constructor(editorGroupService, editorService, contextKeyService, instantiationService) {
|
|
16
18
|
this.editorGroupService = editorGroupService;
|
|
19
|
+
this.instantiationService = instantiationService;
|
|
17
20
|
this._tokenPool = 1;
|
|
18
21
|
this._disposables = ( new DisposableStore());
|
|
19
22
|
this._notebookEditors = ( new Map());
|
|
@@ -140,9 +143,14 @@ let NotebookEditorWidgetService = class NotebookEditorWidgetService {
|
|
|
140
143
|
retrieveWidget(accessor, group, input, creationOptions, initialDimension, codeWindow) {
|
|
141
144
|
let value = this._borrowableEditors.get(group.id)?.get(input.resource);
|
|
142
145
|
if (!value) {
|
|
143
|
-
const
|
|
146
|
+
const editorGroupContextKeyService = accessor.get(IContextKeyService);
|
|
147
|
+
const editorGroupEditorProgressService = accessor.get(IEditorProgressService);
|
|
148
|
+
const notebookInstantiationService = this.instantiationService.createChild(( new ServiceCollection(
|
|
149
|
+
[IContextKeyService, editorGroupContextKeyService],
|
|
150
|
+
[IEditorProgressService, editorGroupEditorProgressService]
|
|
151
|
+
)));
|
|
144
152
|
const ctorOptions = creationOptions ?? getDefaultNotebookCreationOptions();
|
|
145
|
-
const widget =
|
|
153
|
+
const widget = notebookInstantiationService.createInstance(NotebookEditorWidget, {
|
|
146
154
|
...ctorOptions,
|
|
147
155
|
codeWindow: codeWindow ?? ctorOptions.codeWindow,
|
|
148
156
|
}, initialDimension);
|
|
@@ -187,7 +195,8 @@ let NotebookEditorWidgetService = class NotebookEditorWidgetService {
|
|
|
187
195
|
NotebookEditorWidgetService = ( __decorate([
|
|
188
196
|
( __param(0, IEditorGroupsService)),
|
|
189
197
|
( __param(1, IEditorService)),
|
|
190
|
-
( __param(2, IContextKeyService))
|
|
198
|
+
( __param(2, IContextKeyService)),
|
|
199
|
+
( __param(3, IInstantiationService))
|
|
191
200
|
], NotebookEditorWidgetService));
|
|
192
201
|
|
|
193
202
|
export { NotebookEditorWidgetService };
|
|
@@ -33,7 +33,7 @@ let NotebookKernelHistoryService = class NotebookKernelHistoryService extends Di
|
|
|
33
33
|
const selectedKernel = allAvailableKernels.selected;
|
|
34
34
|
const suggested = allAvailableKernels.all.length === 1 ? allAvailableKernels.all[0] : undefined;
|
|
35
35
|
this._notebookLoggingService.debug('History', `getMatchingKernels: ${allAvailableKernels.all.length} kernels available for ${notebook.uri.path}. Selected: ${allAvailableKernels.selected?.label}. Suggested: ${suggested?.label}`);
|
|
36
|
-
const mostRecentKernelIds = this._mostRecentKernelsMap[notebook.
|
|
36
|
+
const mostRecentKernelIds = this._mostRecentKernelsMap[notebook.notebookType] ? [...( (this._mostRecentKernelsMap[notebook.notebookType].values()))] : [];
|
|
37
37
|
const all = ( (mostRecentKernelIds.map(kernelId => allKernels.find(kernel => kernel.id === kernelId)))).filter(kernel => !!kernel);
|
|
38
38
|
this._notebookLoggingService.debug('History', `mru: ${mostRecentKernelIds.length} kernels in history, ${all.length} registered already.`);
|
|
39
39
|
return {
|
package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js
CHANGED
|
@@ -25,12 +25,12 @@ class KernelInfo {
|
|
|
25
25
|
}
|
|
26
26
|
class NotebookTextModelLikeId {
|
|
27
27
|
static str(k) {
|
|
28
|
-
return `${k.
|
|
28
|
+
return `${k.notebookType}/${( k.uri.toString())}`;
|
|
29
29
|
}
|
|
30
30
|
static obj(s) {
|
|
31
31
|
const idx = s.indexOf('/');
|
|
32
32
|
return {
|
|
33
|
-
|
|
33
|
+
notebookType: s.substring(0, idx),
|
|
34
34
|
uri: ( URI.parse(s.substring(idx + 1)))
|
|
35
35
|
};
|
|
36
36
|
}
|
|
@@ -134,7 +134,7 @@ let NotebookKernelService = class NotebookKernelService extends Disposable {
|
|
|
134
134
|
if (kernel.viewType === '*') {
|
|
135
135
|
return 5;
|
|
136
136
|
}
|
|
137
|
-
else if (kernel.viewType === notebook.
|
|
137
|
+
else if (kernel.viewType === notebook.notebookType) {
|
|
138
138
|
return 10;
|
|
139
139
|
}
|
|
140
140
|
else {
|
|
@@ -271,7 +271,7 @@ let NotebookKernelService = class NotebookKernelService extends Disposable {
|
|
|
271
271
|
const stateChangeListener = sourceAction.onDidChangeState(() => {
|
|
272
272
|
this._onDidChangeSourceActions.fire({
|
|
273
273
|
notebook: document.uri,
|
|
274
|
-
viewType: document.
|
|
274
|
+
viewType: document.notebookType,
|
|
275
275
|
});
|
|
276
276
|
});
|
|
277
277
|
sourceActions.push([sourceAction, stateChangeListener]);
|
|
@@ -279,7 +279,7 @@ let NotebookKernelService = class NotebookKernelService extends Disposable {
|
|
|
279
279
|
});
|
|
280
280
|
info.actions = sourceActions;
|
|
281
281
|
this._kernelSources.set(id, info);
|
|
282
|
-
this._onDidChangeSourceActions.fire({ notebook: document.uri, viewType: document.
|
|
282
|
+
this._onDidChangeSourceActions.fire({ notebook: document.uri, viewType: document.notebookType });
|
|
283
283
|
};
|
|
284
284
|
this._kernelSourceActionsUpdates.get(id)?.dispose();
|
|
285
285
|
this._kernelSourceActionsUpdates.set(id, sourceMenu.onDidChange(() => {
|
|
@@ -305,7 +305,7 @@ let NotebookKernelService = class NotebookKernelService extends Disposable {
|
|
|
305
305
|
});
|
|
306
306
|
}
|
|
307
307
|
getKernelDetectionTasks(notebook) {
|
|
308
|
-
return this._kernelDetectionTasks.get(notebook.
|
|
308
|
+
return this._kernelDetectionTasks.get(notebook.notebookType) ?? [];
|
|
309
309
|
}
|
|
310
310
|
registerKernelSourceActionProvider(viewType, provider) {
|
|
311
311
|
const providers = this._kernelSourceActionProviders.get(viewType) ?? [];
|
|
@@ -326,7 +326,7 @@ let NotebookKernelService = class NotebookKernelService extends Disposable {
|
|
|
326
326
|
});
|
|
327
327
|
}
|
|
328
328
|
getKernelSourceActions2(notebook) {
|
|
329
|
-
const viewType = notebook.
|
|
329
|
+
const viewType = notebook.notebookType;
|
|
330
330
|
const providers = this._kernelSourceActionProviders.get(viewType) ?? [];
|
|
331
331
|
const promises = ( providers.map(provider => provider.provideKernelSourceActions()));
|
|
332
332
|
return Promise.all(promises).then(actions => {
|
|
@@ -105,7 +105,6 @@ let NotebookProviderInfoStore = class NotebookProviderInfoStore extends Disposab
|
|
|
105
105
|
selectors: notebookContribution.selector || [],
|
|
106
106
|
priority: this._convertPriority(notebookContribution.priority),
|
|
107
107
|
providerDisplayName: extension.description.displayName ?? extension.description.identifier.value,
|
|
108
|
-
exclusive: false
|
|
109
108
|
}))));
|
|
110
109
|
}
|
|
111
110
|
}
|
|
@@ -135,7 +134,7 @@ let NotebookProviderInfoStore = class NotebookProviderInfoStore extends Disposab
|
|
|
135
134
|
id: notebookProviderInfo.id,
|
|
136
135
|
label: notebookProviderInfo.displayName,
|
|
137
136
|
detail: notebookProviderInfo.providerDisplayName,
|
|
138
|
-
priority: notebookProviderInfo.
|
|
137
|
+
priority: notebookProviderInfo.priority,
|
|
139
138
|
};
|
|
140
139
|
const notebookEditorOptions = {
|
|
141
140
|
canHandleDiff: () => !!this._configurationService.getValue(NotebookSetting.textDiffEditorPreview) && !this._accessibilityService.isScreenReaderOptimized(),
|
|
@@ -157,7 +156,7 @@ let NotebookProviderInfoStore = class NotebookProviderInfoStore extends Disposab
|
|
|
157
156
|
if (!cellOptions) {
|
|
158
157
|
cellOptions = options?.cellOptions;
|
|
159
158
|
}
|
|
160
|
-
const notebookOptions = { ...options, cellOptions };
|
|
159
|
+
const notebookOptions = { ...options, cellOptions, viewState: undefined };
|
|
161
160
|
const editor = NotebookEditorInput.getOrCreate(this._instantiationService, notebookUri, preferredResource, notebookProviderInfo.id);
|
|
162
161
|
return { editor, options: notebookOptions };
|
|
163
162
|
};
|
|
@@ -516,8 +515,7 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
516
515
|
id: viewType,
|
|
517
516
|
displayName: data.displayName,
|
|
518
517
|
providerDisplayName: data.providerDisplayName,
|
|
519
|
-
|
|
520
|
-
priority: RegisteredEditorPriority.default,
|
|
518
|
+
priority: data.priority || RegisteredEditorPriority.default,
|
|
521
519
|
selectors: []
|
|
522
520
|
})));
|
|
523
521
|
info.update({ selectors: data.filenamePattern });
|
|
@@ -565,6 +563,13 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
565
563
|
}
|
|
566
564
|
return result;
|
|
567
565
|
}
|
|
566
|
+
tryGetDataProviderSync(viewType) {
|
|
567
|
+
const selected = this.notebookProviderInfoStore.get(viewType);
|
|
568
|
+
if (!selected) {
|
|
569
|
+
return undefined;
|
|
570
|
+
}
|
|
571
|
+
return this._notebookProviders.get(selected.id);
|
|
572
|
+
}
|
|
568
573
|
_persistMementos() {
|
|
569
574
|
this._memento.saveMemento();
|
|
570
575
|
}
|
|
@@ -154,6 +154,9 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
154
154
|
get alternativeVersionId() {
|
|
155
155
|
return this._alternativeVersionId;
|
|
156
156
|
}
|
|
157
|
+
get notebookType() {
|
|
158
|
+
return this.viewType;
|
|
159
|
+
}
|
|
157
160
|
constructor(viewType, uri, cells, metadata, options, _undoService, _modelService, _languageService, _languageDetectionService) {
|
|
158
161
|
super();
|
|
159
162
|
this.viewType = viewType;
|
package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js
CHANGED
|
@@ -46,7 +46,7 @@ let NotebookModelReferenceCollection = class NotebookModelReferenceCollection ex
|
|
|
46
46
|
isDirty(resource) {
|
|
47
47
|
return this._dirtyStates.get(resource) ?? false;
|
|
48
48
|
}
|
|
49
|
-
async createReferencedObject(key, viewType, hasAssociatedFilePath, limits) {
|
|
49
|
+
async createReferencedObject(key, viewType, hasAssociatedFilePath, limits, isScratchpad) {
|
|
50
50
|
this.modelsToDispose.delete(key);
|
|
51
51
|
const uri = ( URI.parse(key));
|
|
52
52
|
const workingCopyTypeId = NotebookWorkingCopyTypeIdentifier.create(viewType);
|
|
@@ -56,13 +56,14 @@ let NotebookModelReferenceCollection = class NotebookModelReferenceCollection ex
|
|
|
56
56
|
viewType,
|
|
57
57
|
this._notebookService,
|
|
58
58
|
this._configurationService,
|
|
59
|
-
this._telemetryService
|
|
59
|
+
this._telemetryService,
|
|
60
|
+
this._logService
|
|
60
61
|
));
|
|
61
62
|
workingCopyManager = this._instantiationService.createInstance(FileWorkingCopyManager, workingCopyTypeId, factory, factory);
|
|
62
63
|
this._workingCopyManagers.set(workingCopyTypeId, workingCopyManager);
|
|
63
64
|
}
|
|
64
|
-
const
|
|
65
|
-
const model = this._instantiationService.createInstance(SimpleNotebookEditorModel, uri, hasAssociatedFilePath, viewType, workingCopyManager,
|
|
65
|
+
const isScratchpadView = isScratchpad || (viewType === 'interactive' && this._configurationService.getValue(NotebookSetting.InteractiveWindowPromptToSave) !== true);
|
|
66
|
+
const model = this._instantiationService.createInstance(SimpleNotebookEditorModel, uri, hasAssociatedFilePath, viewType, workingCopyManager, isScratchpadView);
|
|
66
67
|
const result = await model.load({ limits });
|
|
67
68
|
let onDirtyAutoReference;
|
|
68
69
|
this._modelListener.set(result, combinedDisposable(result.onDidSave(() => this._onDidSaveNotebook.fire(result.resource)), result.onDidChangeDirty(() => {
|
|
@@ -130,7 +131,7 @@ let NotebookModelResolverServiceImpl = class NotebookModelResolverServiceImpl {
|
|
|
130
131
|
isDirty(resource) {
|
|
131
132
|
return this._data.isDirty(resource);
|
|
132
133
|
}
|
|
133
|
-
async resolve(arg0, viewType,
|
|
134
|
+
async resolve(arg0, viewType, options) {
|
|
134
135
|
let resource;
|
|
135
136
|
let hasAssociatedFilePath = false;
|
|
136
137
|
if (URI.isUri(arg0)) {
|
|
@@ -173,8 +174,9 @@ let NotebookModelResolverServiceImpl = class NotebookModelResolverServiceImpl {
|
|
|
173
174
|
else {
|
|
174
175
|
await this._extensionService.whenInstalledExtensionsRegistered();
|
|
175
176
|
const providers = this._notebookService.getContributedNotebookTypes(resource);
|
|
176
|
-
|
|
177
|
-
|
|
177
|
+
viewType = providers.find(provider => provider.priority === 'exclusive')?.id ??
|
|
178
|
+
providers.find(provider => provider.priority === 'default')?.id ??
|
|
179
|
+
providers[0]?.id;
|
|
178
180
|
}
|
|
179
181
|
}
|
|
180
182
|
if (!viewType) {
|
|
@@ -189,7 +191,7 @@ let NotebookModelResolverServiceImpl = class NotebookModelResolverServiceImpl {
|
|
|
189
191
|
));
|
|
190
192
|
}
|
|
191
193
|
}
|
|
192
|
-
const reference = this._data.acquire(( resource.toString()), viewType, hasAssociatedFilePath, limits);
|
|
194
|
+
const reference = this._data.acquire(( resource.toString()), viewType, hasAssociatedFilePath, options?.limits, options?.scratchpad);
|
|
193
195
|
try {
|
|
194
196
|
const model = await reference.object;
|
|
195
197
|
return {
|
|
@@ -19,7 +19,6 @@ class NotebookProviderInfo {
|
|
|
19
19
|
})) || [];
|
|
20
20
|
this.priority = descriptor.priority;
|
|
21
21
|
this.providerDisplayName = descriptor.providerDisplayName;
|
|
22
|
-
this.exclusive = descriptor.exclusive;
|
|
23
22
|
this._options = {
|
|
24
23
|
transientCellMetadata: {},
|
|
25
24
|
transientDocumentMetadata: {},
|
|
@@ -42,6 +42,7 @@ import 'vscode/vscode/vs/platform/theme/common/colors/minimapColors';
|
|
|
42
42
|
import 'vscode/vscode/vs/platform/theme/common/colors/miscColors';
|
|
43
43
|
import 'vscode/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
44
44
|
import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
|
|
45
|
+
import { IProgressService } from 'vscode/vscode/vs/platform/progress/common/progress.service';
|
|
45
46
|
|
|
46
47
|
var FileWorkingCopyManager_1;
|
|
47
48
|
const _moduleId = "vs/workbench/services/workingCopy/common/fileWorkingCopyManager";
|
|
@@ -49,7 +50,7 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
|
|
|
49
50
|
static { FileWorkingCopyManager_1 = this; }
|
|
50
51
|
static { this.FILE_WORKING_COPY_SAVE_CREATE_SOURCE = SaveSourceRegistry.registerSource('fileWorkingCopyCreate.source', ( localizeWithPath(_moduleId, 0, "File Created"))); }
|
|
51
52
|
static { this.FILE_WORKING_COPY_SAVE_REPLACE_SOURCE = SaveSourceRegistry.registerSource('fileWorkingCopyReplace.source', ( localizeWithPath(_moduleId, 1, "File Replaced"))); }
|
|
52
|
-
constructor(workingCopyTypeId, storedWorkingCopyModelFactory, untitledWorkingCopyModelFactory, fileService, lifecycleService, labelService, logService, workingCopyFileService, workingCopyBackupService, uriIdentityService, fileDialogService, filesConfigurationService, workingCopyService, notificationService, workingCopyEditorService, editorService, elevatedFileService, pathService, environmentService, dialogService, decorationsService) {
|
|
53
|
+
constructor(workingCopyTypeId, storedWorkingCopyModelFactory, untitledWorkingCopyModelFactory, fileService, lifecycleService, labelService, logService, workingCopyFileService, workingCopyBackupService, uriIdentityService, fileDialogService, filesConfigurationService, workingCopyService, notificationService, workingCopyEditorService, editorService, elevatedFileService, pathService, environmentService, dialogService, decorationsService, progressService) {
|
|
53
54
|
super();
|
|
54
55
|
this.workingCopyTypeId = workingCopyTypeId;
|
|
55
56
|
this.storedWorkingCopyModelFactory = storedWorkingCopyModelFactory;
|
|
@@ -79,7 +80,8 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
|
|
|
79
80
|
notificationService,
|
|
80
81
|
workingCopyEditorService,
|
|
81
82
|
editorService,
|
|
82
|
-
elevatedFileService
|
|
83
|
+
elevatedFileService,
|
|
84
|
+
progressService
|
|
83
85
|
))));
|
|
84
86
|
this.untitled = this._register(( (new UntitledFileWorkingCopyManager(
|
|
85
87
|
this.workingCopyTypeId,
|
|
@@ -346,7 +348,8 @@ FileWorkingCopyManager = FileWorkingCopyManager_1 = ( (__decorate([
|
|
|
346
348
|
( (__param(17, IPathService))),
|
|
347
349
|
( (__param(18, IWorkbenchEnvironmentService))),
|
|
348
350
|
( (__param(19, IDialogService))),
|
|
349
|
-
( (__param(20, IDecorationsService)))
|
|
351
|
+
( (__param(20, IDecorationsService))),
|
|
352
|
+
( (__param(21, IProgressService)))
|
|
350
353
|
], FileWorkingCopyManager)));
|
|
351
354
|
|
|
352
355
|
export { FileWorkingCopyManager };
|
|
@@ -26,10 +26,11 @@ import { IWorkingCopyService } from 'vscode/vscode/vs/workbench/services/working
|
|
|
26
26
|
import { isWeb } from 'vscode/vscode/vs/base/common/platform';
|
|
27
27
|
import { onUnexpectedError } from 'vscode/vscode/vs/base/common/errors';
|
|
28
28
|
import { SnapshotContext } from 'vscode/vscode/vs/workbench/services/workingCopy/common/fileWorkingCopy';
|
|
29
|
+
import { IProgressService } from 'vscode/vscode/vs/platform/progress/common/progress.service';
|
|
29
30
|
|
|
30
31
|
const _moduleId = "vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager";
|
|
31
32
|
let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends BaseFileWorkingCopyManager {
|
|
32
|
-
constructor(workingCopyTypeId, modelFactory, fileService, lifecycleService, labelService, logService, workingCopyFileService, workingCopyBackupService, uriIdentityService, filesConfigurationService, workingCopyService, notificationService, workingCopyEditorService, editorService, elevatedFileService) {
|
|
33
|
+
constructor(workingCopyTypeId, modelFactory, fileService, lifecycleService, labelService, logService, workingCopyFileService, workingCopyBackupService, uriIdentityService, filesConfigurationService, workingCopyService, notificationService, workingCopyEditorService, editorService, elevatedFileService, progressService) {
|
|
33
34
|
super(fileService, logService, workingCopyBackupService);
|
|
34
35
|
this.workingCopyTypeId = workingCopyTypeId;
|
|
35
36
|
this.modelFactory = modelFactory;
|
|
@@ -43,6 +44,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
|
|
|
43
44
|
this.workingCopyEditorService = workingCopyEditorService;
|
|
44
45
|
this.editorService = editorService;
|
|
45
46
|
this.elevatedFileService = elevatedFileService;
|
|
47
|
+
this.progressService = progressService;
|
|
46
48
|
this._onDidResolve = this._register(( (new Emitter())));
|
|
47
49
|
this.onDidResolve = this._onDidResolve.event;
|
|
48
50
|
this._onDidChangeDirty = this._register(( (new Emitter())));
|
|
@@ -289,7 +291,8 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
|
|
|
289
291
|
this.notificationService,
|
|
290
292
|
this.workingCopyEditorService,
|
|
291
293
|
this.editorService,
|
|
292
|
-
this.elevatedFileService
|
|
294
|
+
this.elevatedFileService,
|
|
295
|
+
this.progressService
|
|
293
296
|
)));
|
|
294
297
|
workingCopyResolve = workingCopy.resolve(resolveOptions);
|
|
295
298
|
this.registerWorkingCopy(workingCopy);
|
|
@@ -402,7 +405,8 @@ StoredFileWorkingCopyManager = ( (__decorate([
|
|
|
402
405
|
( (__param(11, INotificationService))),
|
|
403
406
|
( (__param(12, IWorkingCopyEditorService))),
|
|
404
407
|
( (__param(13, IEditorService))),
|
|
405
|
-
( (__param(14, IElevatedFileService)))
|
|
408
|
+
( (__param(14, IElevatedFileService))),
|
|
409
|
+
( (__param(15, IProgressService)))
|
|
406
410
|
], StoredFileWorkingCopyManager)));
|
|
407
411
|
|
|
408
412
|
export { StoredFileWorkingCopyManager };
|