@codingame/monaco-vscode-notebook-service-override 11.1.2 → 12.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.d.ts +2 -1
- package/index.js +64 -1
- package/package.json +47 -15
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +43 -41
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +109 -130
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.js +13 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.js +72 -19
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.js +23 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +4 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +30 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookSynchronizerService.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookSynchronizerService.js +76 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +61 -58
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +5 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +4 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +8 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +10 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +52 -50
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +3 -2
- 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.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +28 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +51 -50
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +21 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +4 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +3 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +6 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.d.ts +69 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.js +460 -382
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookSelectionHighlight.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookSelectionHighlight.js +124 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +87 -145
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +16 -15
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +8 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +9 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.d.ts +53 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +40 -36
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.d.ts +112 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +115 -116
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +4 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +111 -117
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +11 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +5 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +7 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +113 -198
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +25 -23
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +115 -145
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +76 -147
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +45 -77
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +30 -35
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.js +19 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +59 -52
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/variablesActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/variablesActions.js +11 -21
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +69 -113
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +194 -184
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.js +51 -51
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.js +14 -36
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.d.ts +48 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +57 -56
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookCellStatusBarServiceImpl.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookCellStatusBarServiceImpl.js +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.d.ts +43 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +29 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +17 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.d.ts +46 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +14 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +21 -19
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +7 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +30 -26
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +6 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +2 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.d.ts +134 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +164 -121
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +2 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +37 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.d.ts +56 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +6 -3
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.d.ts +101 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +131 -55
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +4 -3
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.d.ts +48 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +12 -10
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.js +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.d.ts +50 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.js +75 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorkerMain.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorkerMain.js +2 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.d.ts +31 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +2 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.d.ts +78 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +45 -42
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.d.ts +96 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +57 -54
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.d.ts +74 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +6 -3
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.d.ts +53 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.js +2 -1
- package/worker.js +2 -1
- package/workers/notebook.worker.d.ts +1 -0
- package/notebook.js +0 -50
- package/workers/notebook.worker.js +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import { localize } from 'vscode/vscode/vs/nls';
|
|
3
4
|
import { Event, Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
4
5
|
import { Promises } from 'vscode/vscode/vs/base/common/async';
|
|
@@ -12,10 +13,12 @@ import { SaveSourceRegistry } from 'vscode/vscode/vs/workbench/common/editor';
|
|
|
12
13
|
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
13
14
|
import { IPathService } from 'vscode/vscode/vs/workbench/services/path/common/pathService.service';
|
|
14
15
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
16
|
+
import { StoredFileWorkingCopyState } from '@codingame/monaco-vscode-99f24462-c56d-5407-83fb-2ea9dd33cc8c-common/vscode/vs/workbench/services/workingCopy/common/storedFileWorkingCopy';
|
|
15
17
|
import { StoredFileWorkingCopyManager } from './storedFileWorkingCopyManager.js';
|
|
16
18
|
import { UntitledFileWorkingCopy } from './untitledFileWorkingCopy.js';
|
|
17
19
|
import { UntitledFileWorkingCopyManager } from './untitledFileWorkingCopyManager.js';
|
|
18
20
|
import { IWorkingCopyFileService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService.service';
|
|
21
|
+
import { SnapshotContext } from '@codingame/monaco-vscode-9d05a43d-c330-5ff1-937e-fde4a3852931-common/vscode/vs/workbench/services/workingCopy/common/fileWorkingCopy';
|
|
19
22
|
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
|
|
20
23
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
21
24
|
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
|
|
@@ -45,8 +48,8 @@ import { IProgressService } from 'vscode/vscode/vs/platform/progress/common/prog
|
|
|
45
48
|
var FileWorkingCopyManager_1;
|
|
46
49
|
let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
|
|
47
50
|
static { FileWorkingCopyManager_1 = this; }
|
|
48
|
-
static { this.FILE_WORKING_COPY_SAVE_CREATE_SOURCE = SaveSourceRegistry.registerSource('fileWorkingCopyCreate.source', ( localize(
|
|
49
|
-
static { this.FILE_WORKING_COPY_SAVE_REPLACE_SOURCE = SaveSourceRegistry.registerSource('fileWorkingCopyReplace.source', ( localize(
|
|
51
|
+
static { this.FILE_WORKING_COPY_SAVE_CREATE_SOURCE = SaveSourceRegistry.registerSource('fileWorkingCopyCreate.source', ( localize(12078, "File Created"))); }
|
|
52
|
+
static { this.FILE_WORKING_COPY_SAVE_REPLACE_SOURCE = SaveSourceRegistry.registerSource('fileWorkingCopyReplace.source', ( localize(12079, "File Replaced"))); }
|
|
50
53
|
constructor(workingCopyTypeId, storedWorkingCopyModelFactory, untitledWorkingCopyModelFactory, fileService, lifecycleService, labelService, logService, workingCopyFileService, workingCopyBackupService, uriIdentityService, fileDialogService, filesConfigurationService, workingCopyService, notificationService, workingCopyEditorService, editorService, elevatedFileService, pathService, environmentService, dialogService, decorationsService, progressService) {
|
|
51
54
|
super();
|
|
52
55
|
this.workingCopyTypeId = workingCopyTypeId;
|
|
@@ -62,7 +65,7 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
|
|
|
62
65
|
this.environmentService = environmentService;
|
|
63
66
|
this.dialogService = dialogService;
|
|
64
67
|
this.decorationsService = decorationsService;
|
|
65
|
-
this.stored = this._register((
|
|
68
|
+
this.stored = this._register(( new StoredFileWorkingCopyManager(
|
|
66
69
|
this.workingCopyTypeId,
|
|
67
70
|
this.storedWorkingCopyModelFactory,
|
|
68
71
|
fileService,
|
|
@@ -79,8 +82,8 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
|
|
|
79
82
|
editorService,
|
|
80
83
|
elevatedFileService,
|
|
81
84
|
progressService
|
|
82
|
-
)))
|
|
83
|
-
this.untitled = this._register((
|
|
85
|
+
)));
|
|
86
|
+
this.untitled = this._register(( new UntitledFileWorkingCopyManager(
|
|
84
87
|
this.workingCopyTypeId,
|
|
85
88
|
this.untitledWorkingCopyModelFactory,
|
|
86
89
|
async (workingCopy, options) => {
|
|
@@ -92,7 +95,7 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
|
|
|
92
95
|
logService,
|
|
93
96
|
workingCopyBackupService,
|
|
94
97
|
workingCopyService
|
|
95
|
-
)))
|
|
98
|
+
)));
|
|
96
99
|
this.onDidCreate = Event.any(this.stored.onDidCreate, this.untitled.onDidCreate);
|
|
97
100
|
this.provideDecorations();
|
|
98
101
|
}
|
|
@@ -101,14 +104,14 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
|
|
|
101
104
|
constructor(stored) {
|
|
102
105
|
super();
|
|
103
106
|
this.stored = stored;
|
|
104
|
-
this.label = ( localize(
|
|
105
|
-
this._onDidChange = this._register((
|
|
107
|
+
this.label = ( localize(12080, "File Working Copy Decorations"));
|
|
108
|
+
this._onDidChange = this._register(( new Emitter()));
|
|
106
109
|
this.onDidChange = this._onDidChange.event;
|
|
107
110
|
this.registerListeners();
|
|
108
111
|
}
|
|
109
112
|
registerListeners() {
|
|
110
113
|
this._register(this.stored.onDidResolve(workingCopy => {
|
|
111
|
-
if (workingCopy.isReadonly() || workingCopy.hasState(
|
|
114
|
+
if (workingCopy.isReadonly() || workingCopy.hasState(StoredFileWorkingCopyState.ORPHAN)) {
|
|
112
115
|
this._onDidChange.fire([workingCopy.resource]);
|
|
113
116
|
}
|
|
114
117
|
}));
|
|
@@ -122,26 +125,26 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
|
|
|
122
125
|
return undefined;
|
|
123
126
|
}
|
|
124
127
|
const isReadonly = workingCopy.isReadonly();
|
|
125
|
-
const isOrphaned = workingCopy.hasState(
|
|
128
|
+
const isOrphaned = workingCopy.hasState(StoredFileWorkingCopyState.ORPHAN);
|
|
126
129
|
if (isReadonly && isOrphaned) {
|
|
127
130
|
return {
|
|
128
131
|
color: listErrorForeground,
|
|
129
132
|
letter: Codicon.lockSmall,
|
|
130
133
|
strikethrough: true,
|
|
131
|
-
tooltip: ( localize(
|
|
134
|
+
tooltip: ( localize(12081, "Deleted, Read-only")),
|
|
132
135
|
};
|
|
133
136
|
}
|
|
134
137
|
else if (isReadonly) {
|
|
135
138
|
return {
|
|
136
139
|
letter: Codicon.lockSmall,
|
|
137
|
-
tooltip: ( localize(
|
|
140
|
+
tooltip: ( localize(12082, "Read-only")),
|
|
138
141
|
};
|
|
139
142
|
}
|
|
140
143
|
else if (isOrphaned) {
|
|
141
144
|
return {
|
|
142
145
|
color: listErrorForeground,
|
|
143
146
|
strikethrough: true,
|
|
144
|
-
tooltip: ( localize(
|
|
147
|
+
tooltip: ( localize(12083, "Deleted")),
|
|
145
148
|
};
|
|
146
149
|
}
|
|
147
150
|
return undefined;
|
|
@@ -211,7 +214,7 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
|
|
|
211
214
|
let sourceContents;
|
|
212
215
|
const sourceWorkingCopy = this.get(source);
|
|
213
216
|
if (sourceWorkingCopy?.isResolved()) {
|
|
214
|
-
sourceContents = await sourceWorkingCopy.model.snapshot(
|
|
217
|
+
sourceContents = await sourceWorkingCopy.model.snapshot(SnapshotContext.Save, CancellationToken.None);
|
|
215
218
|
}
|
|
216
219
|
else {
|
|
217
220
|
sourceContents = (await this.fileService.readFileStream(source)).value;
|
|
@@ -273,17 +276,17 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
|
|
|
273
276
|
const { confirmed } = await this.dialogService.confirm({
|
|
274
277
|
type: 'warning',
|
|
275
278
|
message: ( localize(
|
|
276
|
-
|
|
279
|
+
12084,
|
|
277
280
|
"'{0}' already exists. Do you want to replace it?",
|
|
278
281
|
basename(resource)
|
|
279
282
|
)),
|
|
280
283
|
detail: ( localize(
|
|
281
|
-
|
|
284
|
+
12085,
|
|
282
285
|
"A file or folder with the name '{0}' already exists in the folder '{1}'. Replacing it will overwrite its current contents.",
|
|
283
286
|
basename(resource),
|
|
284
287
|
basename(dirname(resource))
|
|
285
288
|
)),
|
|
286
|
-
primaryButton: ( localize(
|
|
289
|
+
primaryButton: ( localize(12086, "&&Replace"))
|
|
287
290
|
});
|
|
288
291
|
return confirmed;
|
|
289
292
|
}
|
|
@@ -291,12 +294,12 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
|
|
|
291
294
|
const { confirmed } = await this.dialogService.confirm({
|
|
292
295
|
type: 'warning',
|
|
293
296
|
message: ( localize(
|
|
294
|
-
|
|
297
|
+
12087,
|
|
295
298
|
"'{0}' is marked as read-only. Do you want to save anyway?",
|
|
296
299
|
basename(resource)
|
|
297
300
|
)),
|
|
298
|
-
detail: ( localize(
|
|
299
|
-
primaryButton: ( localize(
|
|
301
|
+
detail: ( localize(12088, "Paths can be configured as read-only via settings.")),
|
|
302
|
+
primaryButton: ( localize(12089, "&&Save Anyway"))
|
|
300
303
|
});
|
|
301
304
|
return confirmed;
|
|
302
305
|
}
|
|
@@ -324,26 +327,26 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
|
|
|
324
327
|
]);
|
|
325
328
|
}
|
|
326
329
|
};
|
|
327
|
-
FileWorkingCopyManager = FileWorkingCopyManager_1 = (
|
|
328
|
-
(
|
|
329
|
-
(
|
|
330
|
-
(
|
|
331
|
-
(
|
|
332
|
-
(
|
|
333
|
-
(
|
|
334
|
-
(
|
|
335
|
-
(
|
|
336
|
-
(
|
|
337
|
-
(
|
|
338
|
-
(
|
|
339
|
-
(
|
|
340
|
-
(
|
|
341
|
-
(
|
|
342
|
-
(
|
|
343
|
-
(
|
|
344
|
-
(
|
|
345
|
-
(
|
|
346
|
-
(
|
|
347
|
-
], FileWorkingCopyManager))
|
|
330
|
+
FileWorkingCopyManager = FileWorkingCopyManager_1 = ( __decorate([
|
|
331
|
+
( __param(3, IFileService)),
|
|
332
|
+
( __param(4, ILifecycleService)),
|
|
333
|
+
( __param(5, ILabelService)),
|
|
334
|
+
( __param(6, ILogService)),
|
|
335
|
+
( __param(7, IWorkingCopyFileService)),
|
|
336
|
+
( __param(8, IWorkingCopyBackupService)),
|
|
337
|
+
( __param(9, IUriIdentityService)),
|
|
338
|
+
( __param(10, IFileDialogService)),
|
|
339
|
+
( __param(11, IFilesConfigurationService)),
|
|
340
|
+
( __param(12, IWorkingCopyService)),
|
|
341
|
+
( __param(13, INotificationService)),
|
|
342
|
+
( __param(14, IWorkingCopyEditorService)),
|
|
343
|
+
( __param(15, IEditorService)),
|
|
344
|
+
( __param(16, IElevatedFileService)),
|
|
345
|
+
( __param(17, IPathService)),
|
|
346
|
+
( __param(18, IWorkbenchEnvironmentService)),
|
|
347
|
+
( __param(19, IDialogService)),
|
|
348
|
+
( __param(20, IDecorationsService)),
|
|
349
|
+
( __param(21, IProgressService))
|
|
350
|
+
], FileWorkingCopyManager));
|
|
348
351
|
|
|
349
352
|
export { FileWorkingCopyManager };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Event } from "vscode/vscode/vs/base/common/event";
|
|
2
|
+
import { IStoredFileWorkingCopy, IStoredFileWorkingCopyModel, IStoredFileWorkingCopyModelFactory, IStoredFileWorkingCopyResolveOptions, IStoredFileWorkingCopySaveEvent as IBaseStoredFileWorkingCopySaveEvent } from "@codingame/monaco-vscode-99f24462-c56d-5407-83fb-2ea9dd33cc8c-common/vscode/vs/workbench/services/workingCopy/common/storedFileWorkingCopy";
|
|
3
|
+
import { IFileService } from "vscode/vscode/vs/platform/files/common/files.service";
|
|
4
|
+
import { ILifecycleService } from "vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle.service";
|
|
5
|
+
import { URI } from "vscode/vscode/vs/base/common/uri";
|
|
6
|
+
import { ILabelService } from "vscode/vscode/vs/platform/label/common/label.service";
|
|
7
|
+
import { ILogService } from "vscode/vscode/vs/platform/log/common/log.service";
|
|
8
|
+
import { IWorkingCopyFileService } from "vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService.service";
|
|
9
|
+
import { IUriIdentityService } from "vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service";
|
|
10
|
+
import { IWorkingCopyBackupService } from "vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyBackup.service";
|
|
11
|
+
import { BaseFileWorkingCopyManager, IBaseFileWorkingCopyManager } from "./abstractFileWorkingCopyManager.js";
|
|
12
|
+
import { INotificationService } from "vscode/vscode/vs/platform/notification/common/notification.service";
|
|
13
|
+
import { IEditorService } from "vscode/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
14
|
+
import { IElevatedFileService } from "vscode/vscode/vs/workbench/services/files/common/elevatedFileService.service";
|
|
15
|
+
import { IFilesConfigurationService } from "vscode/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.service";
|
|
16
|
+
import { IWorkingCopyEditorService } from "vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyEditorService.service";
|
|
17
|
+
import { IWorkingCopyService } from "vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service";
|
|
18
|
+
import { IProgressService } from "vscode/vscode/vs/platform/progress/common/progress.service";
|
|
19
|
+
export interface IStoredFileWorkingCopyManager<M extends IStoredFileWorkingCopyModel> extends IBaseFileWorkingCopyManager<M, IStoredFileWorkingCopy<M>> {
|
|
20
|
+
readonly onDidResolve: Event<IStoredFileWorkingCopy<M>>;
|
|
21
|
+
readonly onDidChangeDirty: Event<IStoredFileWorkingCopy<M>>;
|
|
22
|
+
readonly onDidChangeReadonly: Event<IStoredFileWorkingCopy<M>>;
|
|
23
|
+
readonly onDidChangeOrphaned: Event<IStoredFileWorkingCopy<M>>;
|
|
24
|
+
readonly onDidSaveError: Event<IStoredFileWorkingCopy<M>>;
|
|
25
|
+
readonly onDidSave: Event<IStoredFileWorkingCopySaveEvent<M>>;
|
|
26
|
+
readonly onDidRevert: Event<IStoredFileWorkingCopy<M>>;
|
|
27
|
+
readonly onDidRemove: Event<URI>;
|
|
28
|
+
resolve(resource: URI, options?: IStoredFileWorkingCopyManagerResolveOptions): Promise<IStoredFileWorkingCopy<M>>;
|
|
29
|
+
canDispose(workingCopy: IStoredFileWorkingCopy<M>): true | Promise<true>;
|
|
30
|
+
}
|
|
31
|
+
export interface IStoredFileWorkingCopySaveEvent<M extends IStoredFileWorkingCopyModel> extends IBaseStoredFileWorkingCopySaveEvent {
|
|
32
|
+
readonly workingCopy: IStoredFileWorkingCopy<M>;
|
|
33
|
+
}
|
|
34
|
+
export interface IStoredFileWorkingCopyManagerResolveOptions extends IStoredFileWorkingCopyResolveOptions {
|
|
35
|
+
readonly reload?: {
|
|
36
|
+
readonly async: boolean;
|
|
37
|
+
readonly force?: boolean;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export declare class StoredFileWorkingCopyManager<M extends IStoredFileWorkingCopyModel> extends BaseFileWorkingCopyManager<M, IStoredFileWorkingCopy<M>> implements IStoredFileWorkingCopyManager<M> {
|
|
41
|
+
private readonly workingCopyTypeId;
|
|
42
|
+
private readonly modelFactory;
|
|
43
|
+
private readonly lifecycleService;
|
|
44
|
+
private readonly labelService;
|
|
45
|
+
private readonly workingCopyFileService;
|
|
46
|
+
private readonly uriIdentityService;
|
|
47
|
+
private readonly filesConfigurationService;
|
|
48
|
+
private readonly workingCopyService;
|
|
49
|
+
private readonly notificationService;
|
|
50
|
+
private readonly workingCopyEditorService;
|
|
51
|
+
private readonly editorService;
|
|
52
|
+
private readonly elevatedFileService;
|
|
53
|
+
private readonly progressService;
|
|
54
|
+
private readonly _onDidResolve;
|
|
55
|
+
readonly onDidResolve: Event<IStoredFileWorkingCopy<M>>;
|
|
56
|
+
private readonly _onDidChangeDirty;
|
|
57
|
+
readonly onDidChangeDirty: Event<IStoredFileWorkingCopy<M>>;
|
|
58
|
+
private readonly _onDidChangeReadonly;
|
|
59
|
+
readonly onDidChangeReadonly: Event<IStoredFileWorkingCopy<M>>;
|
|
60
|
+
private readonly _onDidChangeOrphaned;
|
|
61
|
+
readonly onDidChangeOrphaned: Event<IStoredFileWorkingCopy<M>>;
|
|
62
|
+
private readonly _onDidSaveError;
|
|
63
|
+
readonly onDidSaveError: Event<IStoredFileWorkingCopy<M>>;
|
|
64
|
+
private readonly _onDidSave;
|
|
65
|
+
readonly onDidSave: Event<IStoredFileWorkingCopySaveEvent<M>>;
|
|
66
|
+
private readonly _onDidRevert;
|
|
67
|
+
readonly onDidRevert: Event<IStoredFileWorkingCopy<M>>;
|
|
68
|
+
private readonly _onDidRemove;
|
|
69
|
+
readonly onDidRemove: Event<URI>;
|
|
70
|
+
private readonly mapResourceToWorkingCopyListeners;
|
|
71
|
+
private readonly mapResourceToPendingWorkingCopyResolve;
|
|
72
|
+
private readonly workingCopyResolveQueue;
|
|
73
|
+
constructor(workingCopyTypeId: string, modelFactory: IStoredFileWorkingCopyModelFactory<M>, fileService: IFileService, lifecycleService: ILifecycleService, labelService: ILabelService, logService: ILogService, workingCopyFileService: IWorkingCopyFileService, workingCopyBackupService: IWorkingCopyBackupService, uriIdentityService: IUriIdentityService, filesConfigurationService: IFilesConfigurationService, workingCopyService: IWorkingCopyService, notificationService: INotificationService, workingCopyEditorService: IWorkingCopyEditorService, editorService: IEditorService, elevatedFileService: IElevatedFileService, progressService: IProgressService);
|
|
74
|
+
private registerListeners;
|
|
75
|
+
private onBeforeShutdownWeb;
|
|
76
|
+
private onWillShutdownDesktop;
|
|
77
|
+
private onDidChangeFileSystemProviderCapabilities;
|
|
78
|
+
private onDidChangeFileSystemProviderRegistrations;
|
|
79
|
+
private onDidFilesChange;
|
|
80
|
+
private queueWorkingCopyReloads;
|
|
81
|
+
private queueWorkingCopyReload;
|
|
82
|
+
private readonly mapCorrelationIdToWorkingCopiesToRestore;
|
|
83
|
+
private onWillRunWorkingCopyFileOperation;
|
|
84
|
+
private onDidFailWorkingCopyFileOperation;
|
|
85
|
+
private onDidRunWorkingCopyFileOperation;
|
|
86
|
+
private reload;
|
|
87
|
+
resolve(resource: URI, options?: IStoredFileWorkingCopyManagerResolveOptions): Promise<IStoredFileWorkingCopy<M>>;
|
|
88
|
+
private doResolve;
|
|
89
|
+
private joinPendingResolves;
|
|
90
|
+
private doJoinPendingResolves;
|
|
91
|
+
private registerWorkingCopy;
|
|
92
|
+
protected remove(resource: URI): boolean;
|
|
93
|
+
canDispose(workingCopy: IStoredFileWorkingCopy<M>): true | Promise<true>;
|
|
94
|
+
private doCanDispose;
|
|
95
|
+
dispose(): void;
|
|
96
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import { localize } from 'vscode/vscode/vs/nls';
|
|
3
4
|
import { DisposableStore, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
5
|
import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
|
|
5
|
-
import { StoredFileWorkingCopy } from 'vscode/vscode/vs/workbench/services/workingCopy/common/storedFileWorkingCopy';
|
|
6
|
+
import { StoredFileWorkingCopyState, StoredFileWorkingCopy } from '@codingame/monaco-vscode-99f24462-c56d-5407-83fb-2ea9dd33cc8c-common/vscode/vs/workbench/services/workingCopy/common/storedFileWorkingCopy';
|
|
6
7
|
import { ResourceMap } from 'vscode/vscode/vs/base/common/map';
|
|
7
8
|
import { ResourceQueue, Promises } from 'vscode/vscode/vs/base/common/async';
|
|
9
|
+
import { FileChangeType, FileOperation } from 'vscode/vscode/vs/platform/files/common/files';
|
|
8
10
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
9
11
|
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
10
12
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
@@ -24,6 +26,7 @@ import { IWorkingCopyEditorService } from 'vscode/vscode/vs/workbench/services/w
|
|
|
24
26
|
import { IWorkingCopyService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service';
|
|
25
27
|
import { isWeb } from 'vscode/vscode/vs/base/common/platform';
|
|
26
28
|
import { onUnexpectedError } from 'vscode/vscode/vs/base/common/errors';
|
|
29
|
+
import { SnapshotContext } from '@codingame/monaco-vscode-9d05a43d-c330-5ff1-937e-fde4a3852931-common/vscode/vs/workbench/services/workingCopy/common/fileWorkingCopy';
|
|
27
30
|
import { IProgressService } from 'vscode/vscode/vs/platform/progress/common/progress.service';
|
|
28
31
|
|
|
29
32
|
let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends BaseFileWorkingCopyManager {
|
|
@@ -42,26 +45,26 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
|
|
|
42
45
|
this.editorService = editorService;
|
|
43
46
|
this.elevatedFileService = elevatedFileService;
|
|
44
47
|
this.progressService = progressService;
|
|
45
|
-
this._onDidResolve = this._register((
|
|
48
|
+
this._onDidResolve = this._register(( new Emitter()));
|
|
46
49
|
this.onDidResolve = this._onDidResolve.event;
|
|
47
|
-
this._onDidChangeDirty = this._register((
|
|
50
|
+
this._onDidChangeDirty = this._register(( new Emitter()));
|
|
48
51
|
this.onDidChangeDirty = this._onDidChangeDirty.event;
|
|
49
|
-
this._onDidChangeReadonly = this._register((
|
|
52
|
+
this._onDidChangeReadonly = this._register(( new Emitter()));
|
|
50
53
|
this.onDidChangeReadonly = this._onDidChangeReadonly.event;
|
|
51
|
-
this._onDidChangeOrphaned = this._register((
|
|
54
|
+
this._onDidChangeOrphaned = this._register(( new Emitter()));
|
|
52
55
|
this.onDidChangeOrphaned = this._onDidChangeOrphaned.event;
|
|
53
|
-
this._onDidSaveError = this._register((
|
|
56
|
+
this._onDidSaveError = this._register(( new Emitter()));
|
|
54
57
|
this.onDidSaveError = this._onDidSaveError.event;
|
|
55
|
-
this._onDidSave = this._register((
|
|
58
|
+
this._onDidSave = this._register(( new Emitter()));
|
|
56
59
|
this.onDidSave = this._onDidSave.event;
|
|
57
|
-
this._onDidRevert = this._register((
|
|
60
|
+
this._onDidRevert = this._register(( new Emitter()));
|
|
58
61
|
this.onDidRevert = this._onDidRevert.event;
|
|
59
|
-
this._onDidRemove = this._register((
|
|
62
|
+
this._onDidRemove = this._register(( new Emitter()));
|
|
60
63
|
this.onDidRemove = this._onDidRemove.event;
|
|
61
|
-
this.mapResourceToWorkingCopyListeners = (
|
|
62
|
-
this.mapResourceToPendingWorkingCopyResolve = (
|
|
63
|
-
this.workingCopyResolveQueue = this._register((
|
|
64
|
-
this.mapCorrelationIdToWorkingCopiesToRestore = (
|
|
64
|
+
this.mapResourceToWorkingCopyListeners = ( new ResourceMap());
|
|
65
|
+
this.mapResourceToPendingWorkingCopyResolve = ( new ResourceMap());
|
|
66
|
+
this.workingCopyResolveQueue = this._register(( new ResourceQueue()));
|
|
67
|
+
this.mapCorrelationIdToWorkingCopiesToRestore = ( new Map());
|
|
65
68
|
this.registerListeners();
|
|
66
69
|
}
|
|
67
70
|
registerListeners() {
|
|
@@ -75,23 +78,23 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
|
|
|
75
78
|
this._register(this.lifecycleService.onBeforeShutdown(event => event.veto(this.onBeforeShutdownWeb(), 'veto.fileWorkingCopyManager')));
|
|
76
79
|
}
|
|
77
80
|
else {
|
|
78
|
-
this._register(this.lifecycleService.onWillShutdown(event => event.join(this.onWillShutdownDesktop(), { id: 'join.fileWorkingCopyManager', label: ( localize(
|
|
81
|
+
this._register(this.lifecycleService.onWillShutdown(event => event.join(this.onWillShutdownDesktop(), { id: 'join.fileWorkingCopyManager', label: ( localize(12107, "Saving working copies")) })));
|
|
79
82
|
}
|
|
80
83
|
}
|
|
81
84
|
onBeforeShutdownWeb() {
|
|
82
|
-
if ((
|
|
83
|
-
workingCopy => workingCopy.hasState(
|
|
84
|
-
)))
|
|
85
|
+
if (( this.workingCopies.some(
|
|
86
|
+
workingCopy => workingCopy.hasState(StoredFileWorkingCopyState.PENDING_SAVE)
|
|
87
|
+
))) {
|
|
85
88
|
return true;
|
|
86
89
|
}
|
|
87
90
|
return false;
|
|
88
91
|
}
|
|
89
92
|
async onWillShutdownDesktop() {
|
|
90
93
|
let pendingSavedWorkingCopies;
|
|
91
|
-
while ((pendingSavedWorkingCopies = this.workingCopies.filter(workingCopy => workingCopy.hasState(
|
|
92
|
-
await Promises.settled((
|
|
93
|
-
workingCopy => workingCopy.joinState(
|
|
94
|
-
)))
|
|
94
|
+
while ((pendingSavedWorkingCopies = this.workingCopies.filter(workingCopy => workingCopy.hasState(StoredFileWorkingCopyState.PENDING_SAVE))).length > 0) {
|
|
95
|
+
await Promises.settled(( pendingSavedWorkingCopies.map(
|
|
96
|
+
workingCopy => workingCopy.joinState(StoredFileWorkingCopyState.PENDING_SAVE)
|
|
97
|
+
)));
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
100
|
onDidChangeFileSystemProviderCapabilities(e) {
|
|
@@ -116,7 +119,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
|
|
|
116
119
|
resolveWorkingCopy = schemeOrEvent === workingCopy.resource.scheme;
|
|
117
120
|
}
|
|
118
121
|
else {
|
|
119
|
-
resolveWorkingCopy = schemeOrEvent.contains(workingCopy.resource,
|
|
122
|
+
resolveWorkingCopy = schemeOrEvent.contains(workingCopy.resource, FileChangeType.UPDATED, FileChangeType.ADDED);
|
|
120
123
|
}
|
|
121
124
|
if (resolveWorkingCopy) {
|
|
122
125
|
this.queueWorkingCopyReload(workingCopy);
|
|
@@ -137,7 +140,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
|
|
|
137
140
|
}
|
|
138
141
|
}
|
|
139
142
|
onWillRunWorkingCopyFileOperation(e) {
|
|
140
|
-
if (e.operation ===
|
|
143
|
+
if (e.operation === FileOperation.MOVE || e.operation === FileOperation.COPY) {
|
|
141
144
|
e.waitUntil((async () => {
|
|
142
145
|
const workingCopiesToRestore = [];
|
|
143
146
|
for (const { source, target } of e.files) {
|
|
@@ -163,7 +166,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
|
|
|
163
166
|
workingCopiesToRestore.push({
|
|
164
167
|
source: sourceResource,
|
|
165
168
|
target: targetResource,
|
|
166
|
-
snapshot: sourceWorkingCopy.isDirty() ? await sourceWorkingCopy.model?.snapshot(
|
|
169
|
+
snapshot: sourceWorkingCopy.isDirty() ? await sourceWorkingCopy.model?.snapshot(SnapshotContext.Save, CancellationToken.None) : undefined
|
|
167
170
|
});
|
|
168
171
|
}
|
|
169
172
|
}
|
|
@@ -173,7 +176,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
|
|
|
173
176
|
}
|
|
174
177
|
}
|
|
175
178
|
onDidFailWorkingCopyFileOperation(e) {
|
|
176
|
-
if ((
|
|
179
|
+
if ((e.operation === FileOperation.MOVE || e.operation === FileOperation.COPY)) {
|
|
177
180
|
const workingCopiesToRestore = this.mapCorrelationIdToWorkingCopiesToRestore.get(e.correlationId);
|
|
178
181
|
if (workingCopiesToRestore) {
|
|
179
182
|
this.mapCorrelationIdToWorkingCopiesToRestore.delete(e.correlationId);
|
|
@@ -187,7 +190,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
|
|
|
187
190
|
}
|
|
188
191
|
onDidRunWorkingCopyFileOperation(e) {
|
|
189
192
|
switch (e.operation) {
|
|
190
|
-
case
|
|
193
|
+
case FileOperation.CREATE:
|
|
191
194
|
e.waitUntil((async () => {
|
|
192
195
|
for (const { target } of e.files) {
|
|
193
196
|
const workingCopy = this.get(target);
|
|
@@ -197,19 +200,19 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
|
|
|
197
200
|
}
|
|
198
201
|
})());
|
|
199
202
|
break;
|
|
200
|
-
case
|
|
201
|
-
case
|
|
203
|
+
case FileOperation.MOVE:
|
|
204
|
+
case FileOperation.COPY:
|
|
202
205
|
e.waitUntil((async () => {
|
|
203
206
|
const workingCopiesToRestore = this.mapCorrelationIdToWorkingCopiesToRestore.get(e.correlationId);
|
|
204
207
|
if (workingCopiesToRestore) {
|
|
205
208
|
this.mapCorrelationIdToWorkingCopiesToRestore.delete(e.correlationId);
|
|
206
|
-
await Promises.settled((
|
|
209
|
+
await Promises.settled(( workingCopiesToRestore.map(async (workingCopyToRestore) => {
|
|
207
210
|
const target = this.uriIdentityService.asCanonicalUri(workingCopyToRestore.target);
|
|
208
211
|
await this.resolve(target, {
|
|
209
212
|
reload: { async: false },
|
|
210
213
|
contents: workingCopyToRestore.snapshot
|
|
211
214
|
});
|
|
212
|
-
})))
|
|
215
|
+
})));
|
|
213
216
|
}
|
|
214
217
|
})());
|
|
215
218
|
break;
|
|
@@ -217,7 +220,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
|
|
|
217
220
|
}
|
|
218
221
|
async reload(workingCopy) {
|
|
219
222
|
await this.joinPendingResolves(workingCopy.resource);
|
|
220
|
-
if (workingCopy.isDirty() || workingCopy.isDisposed() || !(
|
|
223
|
+
if (workingCopy.isDirty() || workingCopy.isDisposed() || !( this.has(workingCopy.resource))) {
|
|
221
224
|
return;
|
|
222
225
|
}
|
|
223
226
|
await this.doResolve(workingCopy, { reload: { async: false } });
|
|
@@ -273,7 +276,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
|
|
|
273
276
|
}
|
|
274
277
|
else {
|
|
275
278
|
didCreateWorkingCopy = true;
|
|
276
|
-
workingCopy = (
|
|
279
|
+
workingCopy = ( new StoredFileWorkingCopy(
|
|
277
280
|
this.workingCopyTypeId,
|
|
278
281
|
resource,
|
|
279
282
|
this.labelService.getUriBasenameLabel(resource),
|
|
@@ -290,7 +293,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
|
|
|
290
293
|
this.editorService,
|
|
291
294
|
this.elevatedFileService,
|
|
292
295
|
this.progressService
|
|
293
|
-
))
|
|
296
|
+
));
|
|
294
297
|
workingCopyResolve = workingCopy.resolve(resolveOptions);
|
|
295
298
|
this.registerWorkingCopy(workingCopy);
|
|
296
299
|
}
|
|
@@ -327,7 +330,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
|
|
|
327
330
|
}
|
|
328
331
|
async doJoinPendingResolves(resource) {
|
|
329
332
|
let currentWorkingCopyResolve;
|
|
330
|
-
while ((
|
|
333
|
+
while (( this.mapResourceToPendingWorkingCopyResolve.has(resource))) {
|
|
331
334
|
const nextPendingWorkingCopyResolve = this.mapResourceToPendingWorkingCopyResolve.get(resource);
|
|
332
335
|
if (nextPendingWorkingCopyResolve === currentWorkingCopyResolve) {
|
|
333
336
|
return;
|
|
@@ -341,7 +344,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
|
|
|
341
344
|
}
|
|
342
345
|
}
|
|
343
346
|
registerWorkingCopy(workingCopy) {
|
|
344
|
-
const workingCopyListeners = (
|
|
347
|
+
const workingCopyListeners = ( new DisposableStore());
|
|
345
348
|
workingCopyListeners.add(workingCopy.onDidResolve(() => this._onDidResolve.fire(workingCopy)));
|
|
346
349
|
workingCopyListeners.add(workingCopy.onDidChangeDirty(() => this._onDidChangeDirty.fire(workingCopy)));
|
|
347
350
|
workingCopyListeners.add(workingCopy.onDidChangeReadonly(() => this._onDidChangeReadonly.fire(workingCopy)));
|
|
@@ -365,7 +368,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
|
|
|
365
368
|
}
|
|
366
369
|
canDispose(workingCopy) {
|
|
367
370
|
if (workingCopy.isDisposed() ||
|
|
368
|
-
(!(
|
|
371
|
+
(!( this.mapResourceToPendingWorkingCopyResolve.has(workingCopy.resource)) && !workingCopy.isDirty())) {
|
|
369
372
|
return true;
|
|
370
373
|
}
|
|
371
374
|
return this.doCanDispose(workingCopy);
|
|
@@ -385,25 +388,25 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
|
|
|
385
388
|
dispose() {
|
|
386
389
|
super.dispose();
|
|
387
390
|
this.mapResourceToPendingWorkingCopyResolve.clear();
|
|
388
|
-
dispose((
|
|
391
|
+
dispose(( this.mapResourceToWorkingCopyListeners.values()));
|
|
389
392
|
this.mapResourceToWorkingCopyListeners.clear();
|
|
390
393
|
}
|
|
391
394
|
};
|
|
392
|
-
StoredFileWorkingCopyManager = (
|
|
393
|
-
(
|
|
394
|
-
(
|
|
395
|
-
(
|
|
396
|
-
(
|
|
397
|
-
(
|
|
398
|
-
(
|
|
399
|
-
(
|
|
400
|
-
(
|
|
401
|
-
(
|
|
402
|
-
(
|
|
403
|
-
(
|
|
404
|
-
(
|
|
405
|
-
(
|
|
406
|
-
(
|
|
407
|
-
], StoredFileWorkingCopyManager))
|
|
395
|
+
StoredFileWorkingCopyManager = ( __decorate([
|
|
396
|
+
( __param(2, IFileService)),
|
|
397
|
+
( __param(3, ILifecycleService)),
|
|
398
|
+
( __param(4, ILabelService)),
|
|
399
|
+
( __param(5, ILogService)),
|
|
400
|
+
( __param(6, IWorkingCopyFileService)),
|
|
401
|
+
( __param(7, IWorkingCopyBackupService)),
|
|
402
|
+
( __param(8, IUriIdentityService)),
|
|
403
|
+
( __param(9, IFilesConfigurationService)),
|
|
404
|
+
( __param(10, IWorkingCopyService)),
|
|
405
|
+
( __param(11, INotificationService)),
|
|
406
|
+
( __param(12, IWorkingCopyEditorService)),
|
|
407
|
+
( __param(13, IEditorService)),
|
|
408
|
+
( __param(14, IElevatedFileService)),
|
|
409
|
+
( __param(15, IProgressService))
|
|
410
|
+
], StoredFileWorkingCopyManager));
|
|
408
411
|
|
|
409
412
|
export { StoredFileWorkingCopyManager };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Event } from "vscode/vscode/vs/base/common/event";
|
|
2
|
+
import { VSBufferReadableStream } from "vscode/vscode/vs/base/common/buffer";
|
|
3
|
+
import { IWorkingCopyBackup, IWorkingCopySaveEvent } from "@codingame/monaco-vscode-a4683c2b-a0d2-5112-96ba-eedc605346d2-common/vscode/vs/workbench/services/workingCopy/common/workingCopy";
|
|
4
|
+
import { IFileWorkingCopy, IFileWorkingCopyModel, IFileWorkingCopyModelFactory } from "@codingame/monaco-vscode-9d05a43d-c330-5ff1-937e-fde4a3852931-common/vscode/vs/workbench/services/workingCopy/common/fileWorkingCopy";
|
|
5
|
+
import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
|
|
6
|
+
import { URI } from "vscode/vscode/vs/base/common/uri";
|
|
7
|
+
import { IWorkingCopyService } from "vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service";
|
|
8
|
+
import { CancellationToken } from "vscode/vscode/vs/base/common/cancellation";
|
|
9
|
+
import { ISaveOptions } from "vscode/vscode/vs/workbench/common/editor";
|
|
10
|
+
import { ILogService } from "vscode/vscode/vs/platform/log/common/log.service";
|
|
11
|
+
import { IWorkingCopyBackupService } from "vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyBackup.service";
|
|
12
|
+
export interface IUntitledFileWorkingCopyModelFactory<M extends IUntitledFileWorkingCopyModel> extends IFileWorkingCopyModelFactory<M> {
|
|
13
|
+
}
|
|
14
|
+
export interface IUntitledFileWorkingCopyModel extends IFileWorkingCopyModel {
|
|
15
|
+
readonly onDidChangeContent: Event<IUntitledFileWorkingCopyModelContentChangedEvent>;
|
|
16
|
+
}
|
|
17
|
+
export interface IUntitledFileWorkingCopyModelContentChangedEvent {
|
|
18
|
+
readonly isInitial: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface IUntitledFileWorkingCopy<M extends IUntitledFileWorkingCopyModel> extends IFileWorkingCopy<M> {
|
|
21
|
+
readonly hasAssociatedFilePath: boolean;
|
|
22
|
+
isResolved(): this is IResolvedUntitledFileWorkingCopy<M>;
|
|
23
|
+
}
|
|
24
|
+
export interface IResolvedUntitledFileWorkingCopy<M extends IUntitledFileWorkingCopyModel> extends IUntitledFileWorkingCopy<M> {
|
|
25
|
+
readonly model: M;
|
|
26
|
+
}
|
|
27
|
+
export interface IUntitledFileWorkingCopySaveDelegate<M extends IUntitledFileWorkingCopyModel> {
|
|
28
|
+
(workingCopy: IUntitledFileWorkingCopy<M>, options?: ISaveOptions): Promise<boolean>;
|
|
29
|
+
}
|
|
30
|
+
export interface IUntitledFileWorkingCopyInitialContents {
|
|
31
|
+
readonly value: VSBufferReadableStream;
|
|
32
|
+
readonly markModified?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare class UntitledFileWorkingCopy<M extends IUntitledFileWorkingCopyModel> extends Disposable implements IUntitledFileWorkingCopy<M> {
|
|
35
|
+
readonly typeId: string;
|
|
36
|
+
readonly resource: URI;
|
|
37
|
+
readonly name: string;
|
|
38
|
+
readonly hasAssociatedFilePath: boolean;
|
|
39
|
+
private readonly isScratchpad;
|
|
40
|
+
private readonly initialContents;
|
|
41
|
+
private readonly modelFactory;
|
|
42
|
+
private readonly saveDelegate;
|
|
43
|
+
private readonly workingCopyBackupService;
|
|
44
|
+
private readonly logService;
|
|
45
|
+
readonly capabilities: number;
|
|
46
|
+
private _model;
|
|
47
|
+
get model(): M | undefined;
|
|
48
|
+
private readonly _onDidChangeContent;
|
|
49
|
+
readonly onDidChangeContent: Event<void>;
|
|
50
|
+
private readonly _onDidChangeDirty;
|
|
51
|
+
readonly onDidChangeDirty: Event<void>;
|
|
52
|
+
private readonly _onDidSave;
|
|
53
|
+
readonly onDidSave: Event<IWorkingCopySaveEvent>;
|
|
54
|
+
private readonly _onDidRevert;
|
|
55
|
+
readonly onDidRevert: Event<void>;
|
|
56
|
+
private readonly _onWillDispose;
|
|
57
|
+
readonly onWillDispose: Event<void>;
|
|
58
|
+
constructor(typeId: string, resource: URI, name: string, hasAssociatedFilePath: boolean, isScratchpad: boolean, initialContents: IUntitledFileWorkingCopyInitialContents | undefined, modelFactory: IUntitledFileWorkingCopyModelFactory<M>, saveDelegate: IUntitledFileWorkingCopySaveDelegate<M>, workingCopyService: IWorkingCopyService, workingCopyBackupService: IWorkingCopyBackupService, logService: ILogService);
|
|
59
|
+
private modified;
|
|
60
|
+
isDirty(): boolean;
|
|
61
|
+
isModified(): boolean;
|
|
62
|
+
private setModified;
|
|
63
|
+
resolve(): Promise<void>;
|
|
64
|
+
private doCreateModel;
|
|
65
|
+
private installModelListeners;
|
|
66
|
+
private onModelContentChanged;
|
|
67
|
+
isResolved(): this is IResolvedUntitledFileWorkingCopy<M>;
|
|
68
|
+
get backupDelay(): number | undefined;
|
|
69
|
+
backup(token: CancellationToken): Promise<IWorkingCopyBackup>;
|
|
70
|
+
save(options?: ISaveOptions): Promise<boolean>;
|
|
71
|
+
revert(): Promise<void>;
|
|
72
|
+
dispose(): void;
|
|
73
|
+
private trace;
|
|
74
|
+
}
|