@codingame/monaco-vscode-editor-service-override 4.4.1 → 4.5.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/editor.js +5 -4
- package/package.json +10 -2
- package/tools/editor.d.ts +12 -12
- package/tools/editor.js +12 -12
- package/tools.js +38 -1
package/editor.js
CHANGED
|
@@ -2,14 +2,15 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
|
2
2
|
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
3
3
|
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
4
4
|
import { CodeEditorService } from 'vscode/vscode/vs/workbench/services/editor/browser/codeEditorService';
|
|
5
|
-
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
5
|
+
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
6
6
|
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { TextEditorService } from 'vscode/vscode/vs/workbench/services/textfile/common/textEditorService';
|
|
8
|
+
import { ITextEditorService } from 'vscode/vscode/vs/workbench/services/textfile/common/textEditorService.service';
|
|
9
|
+
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
9
10
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
10
11
|
import { DEFAULT_EDITOR_PART_OPTIONS } from 'vscode/vscode/vs/workbench/browser/parts/editor/editor';
|
|
11
12
|
import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
|
|
12
|
-
import { MonacoDelegateEditorGroupsService, MonacoEditorService
|
|
13
|
+
import { fakeActiveGroup, MonacoDelegateEditorGroupsService, MonacoEditorService } from './tools/editor.js';
|
|
13
14
|
import { unsupported } from './tools.js';
|
|
14
15
|
import 'vscode/vscode/vs/workbench/browser/parts/editor/editor.autosave.contribution';
|
|
15
16
|
import 'vscode/vscode/vs/workbench/contrib/files/browser/files.fileEditorFactory.contribution';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-editor-service-override",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -17,7 +17,15 @@
|
|
|
17
17
|
"main": "index.js",
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"default": "./index.js"
|
|
23
|
+
},
|
|
24
|
+
"./vscode/*": {
|
|
25
|
+
"default": "./vscode/src/*.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
20
28
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@4.
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@4.5.0"
|
|
22
30
|
}
|
|
23
31
|
}
|
package/tools/editor.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { IEditorPane, IUntypedEditorInput, IUntitledTextResourceEditorInput, IResourceDiffEditorInput, ITextDiffEditorPane } from 'vscode/vscode/vs/workbench/common/editor';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { IReference } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
+
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
4
4
|
import { EditorInput } from 'vscode/vscode/vs/workbench/common/editor/editorInput';
|
|
5
5
|
import { IEditorOptions, IResourceEditorInput, ITextResourceEditorInput } from 'vscode/vscode/vs/platform/editor/common/editor';
|
|
6
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
7
|
+
import { PreferredGroup } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
6
8
|
import { ICodeEditor, IDiffEditor } from 'vscode/vscode/vs/editor/browser/editorBrowser';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files';
|
|
11
|
-
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
12
|
-
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity';
|
|
13
|
-
import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host';
|
|
9
|
+
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
10
|
+
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
11
|
+
import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host.service';
|
|
14
12
|
import { IResolvedTextEditorModel, ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
|
|
15
13
|
import { EditorService } from 'vscode/vscode/vs/workbench/services/editor/browser/editorService';
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
14
|
+
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
15
|
+
import { IWorkspaceTrustRequestService } from 'vscode/vscode/vs/platform/workspace/common/workspaceTrust.service';
|
|
16
|
+
import { IEditorResolverService } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService.service';
|
|
17
|
+
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|
|
18
|
+
import { ITextEditorService } from 'vscode/vscode/vs/workbench/services/textfile/common/textEditorService.service';
|
|
19
19
|
|
|
20
20
|
type OpenEditor = (modelRef: IReference<IResolvedTextEditorModel>, options: IEditorOptions | undefined, sideBySide?: boolean) => Promise<ICodeEditor | undefined>;
|
|
21
21
|
declare class MonacoEditorService extends EditorService {
|
package/tools/editor.js
CHANGED
|
@@ -2,26 +2,26 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
|
2
2
|
import { StandaloneServices } from 'vscode/vscode/vs/editor/standalone/browser/standaloneServices';
|
|
3
3
|
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
4
4
|
import { isPreferredGroup, SIDE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
5
|
-
import {
|
|
5
|
+
import { isEditorInput, isResourceEditorInput, EditorCloseContext } from 'vscode/vscode/vs/workbench/common/editor';
|
|
6
6
|
import { applyTextEditorOptions } from 'vscode/vscode/vs/workbench/common/editor/editorOptions';
|
|
7
7
|
import { DEFAULT_EDITOR_MIN_DIMENSIONS, DEFAULT_EDITOR_MAX_DIMENSIONS } from 'vscode/vscode/vs/workbench/browser/parts/editor/editor';
|
|
8
8
|
import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
|
|
9
|
-
import {
|
|
9
|
+
import { StandaloneEditor, StandaloneCodeEditor } from 'vscode/vscode/vs/editor/standalone/browser/standaloneCodeEditor';
|
|
10
10
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
11
11
|
import { EditorService } from 'vscode/vscode/vs/workbench/services/editor/browser/editorService';
|
|
12
|
-
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
12
|
+
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
13
13
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
14
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
15
|
-
import { IWorkspaceTrustRequestService } from 'vscode/vscode/vs/platform/workspace/common/workspaceTrust';
|
|
16
|
-
import { IEditorResolverService } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService';
|
|
17
|
-
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity';
|
|
18
|
-
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
19
|
-
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files';
|
|
20
|
-
import { ITextEditorService } from 'vscode/vscode/vs/workbench/services/textfile/common/textEditorService';
|
|
21
|
-
import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host';
|
|
14
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
15
|
+
import { IWorkspaceTrustRequestService } from 'vscode/vscode/vs/platform/workspace/common/workspaceTrust.service';
|
|
16
|
+
import { IEditorResolverService } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService.service';
|
|
17
|
+
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
18
|
+
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|
|
19
|
+
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
20
|
+
import { ITextEditorService } from 'vscode/vscode/vs/workbench/services/textfile/common/textEditorService.service';
|
|
21
|
+
import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host.service';
|
|
22
22
|
import { Event, Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
23
23
|
import { TextResourceEditorInput } from 'vscode/vscode/vs/workbench/common/editor/textResourceEditorInput';
|
|
24
|
-
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
24
|
+
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
25
25
|
import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
|
|
26
26
|
import { unsupported } from '../tools.js';
|
|
27
27
|
|
package/tools.js
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
function unsupported() {
|
|
2
2
|
throw new Error('unsupported');
|
|
3
3
|
}
|
|
4
|
+
function memoized(fct) {
|
|
5
|
+
let v = null;
|
|
6
|
+
return (...args) => {
|
|
7
|
+
if (v == null) {
|
|
8
|
+
v = fct(...args);
|
|
9
|
+
}
|
|
10
|
+
return v;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function memoizedConstructor(ctor) {
|
|
14
|
+
return new Proxy(ctor, {
|
|
15
|
+
construct: memoized((target, args) => {
|
|
16
|
+
return Reflect.construct(ctor, args);
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
async function sleep(duration) {
|
|
21
|
+
await new Promise(resolve => setTimeout(resolve, duration));
|
|
22
|
+
}
|
|
23
|
+
function throttle(fct, merge, delay) {
|
|
24
|
+
let lastPromise = Promise.resolve();
|
|
25
|
+
let toConsume = null;
|
|
26
|
+
return async (param) => {
|
|
27
|
+
if (toConsume == null) {
|
|
28
|
+
toConsume = param;
|
|
29
|
+
lastPromise = lastPromise.then(async () => sleep(delay)).then(async () => {
|
|
30
|
+
const _toConsume = toConsume;
|
|
31
|
+
toConsume = null;
|
|
32
|
+
await fct(_toConsume);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
toConsume = merge(toConsume, param);
|
|
37
|
+
}
|
|
38
|
+
await lastPromise;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
4
41
|
|
|
5
|
-
export { unsupported };
|
|
42
|
+
export { memoized, memoizedConstructor, sleep, throttle, unsupported };
|