@codingame/monaco-vscode-files-service-override 1.85.1 → 1.85.2
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/files.js +13 -4
- package/index.js +1 -1
- package/override/vs/platform/dialogs/common/dialogs.js +8 -0
- package/package.json +2 -2
- package/vscode/src/vs/workbench/services/files/browser/elevatedFileService.js +10 -0
- package/vscode/src/vs/workbench/services/textfile/browser/browserTextFileService.js +58 -0
- package/vscode/src/vs/workbench/services/textfile/browser/textFileService.js +641 -0
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModelManager.js +404 -0
- package/vscode/src/vs/workbench/services/textfile/common/textFileSaveParticipant.js +64 -0
- package/vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.js +0 -222
package/files.js
CHANGED
|
@@ -2,7 +2,8 @@ import { __decorate, __param } from './external/tslib/tslib.es6.js';
|
|
|
2
2
|
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
3
3
|
import { FileService } from './vscode/src/vs/platform/files/common/fileService.js';
|
|
4
4
|
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
5
|
-
import { InMemoryFileSystemProvider } from '
|
|
5
|
+
import { InMemoryFileSystemProvider } from 'vscode/vscode/vs/platform/files/common/inMemoryFilesystemProvider';
|
|
6
|
+
export { InMemoryFileSystemProvider } from 'vscode/vscode/vs/platform/files/common/inMemoryFilesystemProvider';
|
|
6
7
|
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
7
8
|
import { FileType, FilePermission, toFileSystemProviderErrorCode } from './vscode/src/vs/platform/files/common/files.js';
|
|
8
9
|
export { FileChangeType, FileSystemProviderCapabilities } from './vscode/src/vs/platform/files/common/files.js';
|
|
@@ -21,8 +22,13 @@ export { IndexedDB } from 'monaco-editor/esm/vs/base/browser/indexedDB.js';
|
|
|
21
22
|
import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
22
23
|
import { BufferLogger } from 'vscode/vscode/vs/platform/log/common/bufferLog';
|
|
23
24
|
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
24
|
-
import {
|
|
25
|
+
import { ITextFileService } from 'vscode/vscode/vs/workbench/services/textfile/common/textfiles';
|
|
26
|
+
import { BrowserTextFileService } from './vscode/src/vs/workbench/services/textfile/browser/browserTextFileService.js';
|
|
27
|
+
import { IFilesConfigurationService, FilesConfigurationService } from 'vscode/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
|
28
|
+
import { BrowserElevatedFileService } from './vscode/src/vs/workbench/services/files/browser/elevatedFileService.js';
|
|
29
|
+
import { IElevatedFileService } from 'vscode/vscode/vs/workbench/services/files/common/elevatedFileService';
|
|
25
30
|
import { registerServiceInitializePreParticipant, checkServicesNotInitialized } from 'vscode/lifecycle';
|
|
31
|
+
import { logsPath } from 'vscode/workbench';
|
|
26
32
|
|
|
27
33
|
class RegisteredFile {
|
|
28
34
|
constructor(uri, readonly) {
|
|
@@ -472,7 +478,10 @@ registerServiceInitializePreParticipant(async (accessor) => {
|
|
|
472
478
|
});
|
|
473
479
|
function getServiceOverride() {
|
|
474
480
|
return {
|
|
475
|
-
[( IFileService.toString())]: new SyncDescriptor(MemoryFileService, [fileLogger], true)
|
|
481
|
+
[( IFileService.toString())]: new SyncDescriptor(MemoryFileService, [fileLogger], true),
|
|
482
|
+
[( ITextFileService.toString())]: new SyncDescriptor(BrowserTextFileService, [], true),
|
|
483
|
+
[( IFilesConfigurationService.toString())]: new SyncDescriptor(FilesConfigurationService, [], true),
|
|
484
|
+
[( IElevatedFileService.toString())]: new SyncDescriptor(BrowserElevatedFileService, [], true)
|
|
476
485
|
};
|
|
477
486
|
}
|
|
478
487
|
function registerCustomProvider(scheme, provider) {
|
|
@@ -517,4 +526,4 @@ function registerFileSystemOverlay(priority, provider) {
|
|
|
517
526
|
return fileSystemProvider.register(priority, provider);
|
|
518
527
|
}
|
|
519
528
|
|
|
520
|
-
export { CustomSchemas, DelegateFileSystemProvider, FilePermission, FileType,
|
|
529
|
+
export { CustomSchemas, DelegateFileSystemProvider, FilePermission, FileType, IndexedDBFileSystemProvider, RegisteredFile, RegisteredFileSystemProvider, RegisteredMemoryFile, RegisteredReadOnlyFile, createIndexedDBProviders, getServiceOverride as default, initFile, registerCustomProvider, registerExtensionFile, registerFileSystemOverlay };
|
package/index.js
CHANGED
|
@@ -3,5 +3,5 @@ export { FileChangeType, FilePermission, FileSystemProviderCapabilities, FileTyp
|
|
|
3
3
|
export { FileSystemProviderError, FileSystemProviderErrorCode } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
4
4
|
export { HTMLFileSystemProvider } from 'monaco-editor/esm/vs/platform/files/browser/htmlFileSystemProvider.js';
|
|
5
5
|
export { IndexedDB } from 'monaco-editor/esm/vs/base/browser/indexedDB.js';
|
|
6
|
-
export { InMemoryFileSystemProvider } from '
|
|
6
|
+
export { InMemoryFileSystemProvider } from 'vscode/vscode/vs/platform/files/common/inMemoryFilesystemProvider';
|
|
7
7
|
export { IndexedDBFileSystemProvider } from './vscode/src/vs/platform/files/browser/indexedDBFileSystemProvider.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var ConfirmResult;
|
|
2
|
+
( (function(ConfirmResult) {
|
|
3
|
+
ConfirmResult[ConfirmResult["SAVE"] = 0] = "SAVE";
|
|
4
|
+
ConfirmResult[ConfirmResult["DONT_SAVE"] = 1] = "DONT_SAVE";
|
|
5
|
+
ConfirmResult[ConfirmResult["CANCEL"] = 2] = "CANCEL";
|
|
6
|
+
})(ConfirmResult || (ConfirmResult = {})));
|
|
7
|
+
|
|
8
|
+
export { ConfirmResult };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-files-service-override",
|
|
3
|
-
"version": "1.85.
|
|
3
|
+
"version": "1.85.2",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@1.85.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.85.2",
|
|
22
22
|
"monaco-editor": "0.45.0"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { AbstractTextFileService } from './textFileService.js';
|
|
3
|
+
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
|
|
4
|
+
import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
|
|
5
|
+
import { IModelService } from 'monaco-editor/esm/vs/editor/common/services/model.js';
|
|
6
|
+
import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
|
|
7
|
+
import { ITextResourceConfigurationService } from 'monaco-editor/esm/vs/editor/common/services/textResourceConfiguration.js';
|
|
8
|
+
import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
9
|
+
import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
10
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
11
|
+
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
12
|
+
import { IElevatedFileService } from 'vscode/vscode/vs/workbench/services/files/common/elevatedFileService';
|
|
13
|
+
import { IFilesConfigurationService } from 'vscode/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
|
14
|
+
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
15
|
+
import { IPathService } from 'vscode/vscode/vs/workbench/services/path/common/pathService';
|
|
16
|
+
import { IUntitledTextEditorService } from 'vscode/vscode/vs/workbench/services/untitled/common/untitledTextEditorService';
|
|
17
|
+
import { IUriIdentityService } from 'monaco-editor/esm/vs/platform/uriIdentity/common/uriIdentity.js';
|
|
18
|
+
import { IWorkingCopyFileService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService';
|
|
19
|
+
import { IDecorationsService } from 'vscode/vscode/vs/workbench/services/decorations/common/decorations';
|
|
20
|
+
import { IDialogService, IFileDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
|
|
21
|
+
|
|
22
|
+
let BrowserTextFileService = class BrowserTextFileService extends AbstractTextFileService {
|
|
23
|
+
constructor(fileService, untitledTextEditorService, lifecycleService, instantiationService, modelService, environmentService, dialogService, fileDialogService, textResourceConfigurationService, filesConfigurationService, codeEditorService, pathService, workingCopyFileService, uriIdentityService, languageService, elevatedFileService, logService, decorationsService) {
|
|
24
|
+
super(fileService, untitledTextEditorService, lifecycleService, instantiationService, modelService, environmentService, dialogService, fileDialogService, textResourceConfigurationService, filesConfigurationService, codeEditorService, pathService, workingCopyFileService, uriIdentityService, languageService, logService, elevatedFileService, decorationsService);
|
|
25
|
+
this.registerListeners();
|
|
26
|
+
}
|
|
27
|
+
registerListeners() {
|
|
28
|
+
this._register(this.lifecycleService.onBeforeShutdown(event => event.veto(this.onBeforeShutdown(), 'veto.textFiles')));
|
|
29
|
+
}
|
|
30
|
+
onBeforeShutdown() {
|
|
31
|
+
if (( this.files.models.some(model => model.hasState(2 )))) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
BrowserTextFileService = ( __decorate([
|
|
38
|
+
( __param(0, IFileService)),
|
|
39
|
+
( __param(1, IUntitledTextEditorService)),
|
|
40
|
+
( __param(2, ILifecycleService)),
|
|
41
|
+
( __param(3, IInstantiationService)),
|
|
42
|
+
( __param(4, IModelService)),
|
|
43
|
+
( __param(5, IWorkbenchEnvironmentService)),
|
|
44
|
+
( __param(6, IDialogService)),
|
|
45
|
+
( __param(7, IFileDialogService)),
|
|
46
|
+
( __param(8, ITextResourceConfigurationService)),
|
|
47
|
+
( __param(9, IFilesConfigurationService)),
|
|
48
|
+
( __param(10, ICodeEditorService)),
|
|
49
|
+
( __param(11, IPathService)),
|
|
50
|
+
( __param(12, IWorkingCopyFileService)),
|
|
51
|
+
( __param(13, IUriIdentityService)),
|
|
52
|
+
( __param(14, ILanguageService)),
|
|
53
|
+
( __param(15, IElevatedFileService)),
|
|
54
|
+
( __param(16, ILogService)),
|
|
55
|
+
( __param(17, IDecorationsService))
|
|
56
|
+
], BrowserTextFileService));
|
|
57
|
+
|
|
58
|
+
export { BrowserTextFileService };
|