@codingame/monaco-vscode-base-service-override 11.1.1 → 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.
Files changed (41) hide show
  1. package/index.d.ts +2 -1
  2. package/index.js +65 -1
  3. package/package.json +31 -7
  4. package/vscode/src/vs/base/parts/request/common/requestImpl.d.ts +3 -0
  5. package/vscode/src/vs/base/parts/request/{browser/request.js → common/requestImpl.js} +11 -6
  6. package/vscode/src/vs/platform/download/common/downloadService.d.ts +12 -0
  7. package/vscode/src/vs/platform/download/common/downloadService.js +2 -1
  8. package/vscode/src/vs/platform/request/common/requestIpc.d.ts +22 -0
  9. package/vscode/src/vs/platform/request/common/requestIpc.js +1 -0
  10. package/vscode/src/vs/platform/url/common/urlService.d.ts +17 -0
  11. package/vscode/src/vs/platform/url/common/urlService.js +3 -0
  12. package/vscode/src/vs/workbench/contrib/codeEditor/browser/workbenchEditorWorkerService.d.ts +9 -0
  13. package/vscode/src/vs/workbench/contrib/codeEditor/browser/workbenchEditorWorkerService.js +2 -1
  14. package/vscode/src/vs/workbench/services/configuration/common/jsonEditingService.d.ts +24 -0
  15. package/vscode/src/vs/workbench/services/configuration/common/jsonEditingService.js +21 -19
  16. package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.d.ts +24 -0
  17. package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +29 -27
  18. package/vscode/src/vs/workbench/services/label/common/labelService.d.ts +47 -0
  19. package/vscode/src/vs/workbench/services/label/common/labelService.js +49 -44
  20. package/vscode/src/vs/workbench/services/path/browser/pathService.d.ts +9 -0
  21. package/vscode/src/vs/workbench/services/path/browser/pathService.js +2 -0
  22. package/vscode/src/vs/workbench/services/path/common/pathService.d.ts +32 -0
  23. package/vscode/src/vs/workbench/services/path/common/pathService.js +7 -6
  24. package/vscode/src/vs/workbench/services/request/browser/requestService.d.ts +19 -0
  25. package/vscode/src/vs/workbench/services/request/browser/requestService.js +4 -3
  26. package/vscode/src/vs/workbench/services/url/browser/urlService.d.ts +15 -0
  27. package/vscode/src/vs/workbench/services/url/browser/urlService.js +3 -1
  28. package/vscode/src/vs/workbench/services/userActivity/common/userActivityRegistry.d.ts +11 -0
  29. package/vscode/src/vs/workbench/services/userActivity/common/userActivityRegistry.js +2 -0
  30. package/vscode/src/vs/workbench/services/userActivity/common/userActivityService.d.ts +17 -0
  31. package/vscode/src/vs/workbench/services/userActivity/common/userActivityService.js +3 -1
  32. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant.d.ts +17 -0
  33. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant.js +13 -11
  34. package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyFileOperationParticipant.d.ts +15 -0
  35. package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyFileOperationParticipant.js +2 -1
  36. package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyFileService.d.ts +89 -0
  37. package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyFileService.js +10 -7
  38. package/vscode/src/vs/workbench/services/workspaces/common/canonicalUriService.d.ts +11 -0
  39. package/vscode/src/vs/workbench/services/workspaces/common/canonicalUriService.js +2 -0
  40. package/base.js +0 -63
  41. package/vscode/src/vs/workbench/services/configuration/common/jsonEditing.js +0 -8
package/index.d.ts CHANGED
@@ -1 +1,2 @@
1
- export { default } from 'vscode/service-override/base';
1
+ import { type IEditorOverrideServices } from "vscode/vscode/vs/editor/standalone/browser/standaloneServices";
2
+ export default function getServiceOverride(): IEditorOverrideServices;
package/index.js CHANGED
@@ -1 +1,65 @@
1
- export { default } from './base.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
3
+ import 'vscode/vscode/vs/editor/standalone/browser/standaloneServices';
4
+ import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
5
+ import { IRequestService } from 'vscode/vscode/vs/platform/request/common/request.service';
6
+ import { IDecorationsService } from 'vscode/vscode/vs/workbench/services/decorations/common/decorations.service';
7
+ import { IJSONEditingService } from 'vscode/vscode/vs/workbench/services/configuration/common/jsonEditing.service';
8
+ import { ITreeViewsDnDService } from 'vscode/vscode/vs/editor/common/services/treeViewsDndService';
9
+ import { TreeViewsDnDService } from 'vscode/vscode/vs/editor/common/services/treeViewsDnd';
10
+ import { IURLService } from 'vscode/vscode/vs/platform/url/common/url.service';
11
+ import { JSONEditingService } from './vscode/src/vs/workbench/services/configuration/common/jsonEditingService.js';
12
+ import { DecorationsService } from './vscode/src/vs/workbench/services/decorations/browser/decorationsService.js';
13
+ import { BrowserRequestService } from './vscode/src/vs/workbench/services/request/browser/requestService.js';
14
+ import { BrowserURLService } from './vscode/src/vs/workbench/services/url/browser/urlService.js';
15
+ import { CanonicalUriService } from './vscode/src/vs/workbench/services/workspaces/common/canonicalUriService.js';
16
+ import { ICanonicalUriService } from 'vscode/vscode/vs/platform/workspace/common/canonicalUri.service';
17
+ import { IUserActivityService } from 'vscode/vscode/vs/workbench/services/userActivity/common/userActivityService.service';
18
+ import { IDownloadService } from 'vscode/vscode/vs/platform/download/common/download.service';
19
+ import { DownloadService } from './vscode/src/vs/platform/download/common/downloadService.js';
20
+ import { IPathService } from 'vscode/vscode/vs/workbench/services/path/common/pathService.service';
21
+ import { IWorkingCopyFileService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService.service';
22
+ import { IRemoteAgentService } from 'vscode/vscode/vs/workbench/services/remote/common/remoteAgentService.service';
23
+ import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService.service';
24
+ import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
25
+ import { guessLocalUserHome } from './vscode/src/vs/workbench/services/path/browser/pathService.js';
26
+ import { AbstractPathService } from './vscode/src/vs/workbench/services/path/common/pathService.js';
27
+ import { UserActivityService } from './vscode/src/vs/workbench/services/userActivity/common/userActivityService.js';
28
+ import { WorkingCopyFileService } from './vscode/src/vs/workbench/services/workingCopy/common/workingCopyFileService.js';
29
+ import { ITrustedDomainService } from 'vscode/vscode/vs/workbench/contrib/url/browser/trustedDomainService.service';
30
+ import { TrustedDomainService } from '@codingame/monaco-vscode-9a1a5840-af83-5d07-a156-ba32a36c5c4b-common/vscode/vs/workbench/contrib/url/browser/trustedDomainService';
31
+ import { LabelService } from './vscode/src/vs/workbench/services/label/common/labelService.js';
32
+ import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
33
+ import { IEditorWorkerService } from 'vscode/vscode/vs/editor/common/services/editorWorker';
34
+ import { WorkbenchEditorWorkerService } from './vscode/src/vs/workbench/contrib/codeEditor/browser/workbenchEditorWorkerService.js';
35
+ import { getEnvironmentOverride } from 'vscode/workbench';
36
+
37
+ let BrowserPathServiceOverride = class BrowserPathServiceOverride extends AbstractPathService {
38
+ constructor(remoteAgentService, environmentService, contextService) {
39
+ super(getEnvironmentOverride().userHome ?? guessLocalUserHome(environmentService, contextService), remoteAgentService, environmentService, contextService);
40
+ }
41
+ };
42
+ BrowserPathServiceOverride = __decorate([
43
+ __param(0, IRemoteAgentService),
44
+ __param(1, IWorkbenchEnvironmentService),
45
+ __param(2, IWorkspaceContextService)
46
+ ], BrowserPathServiceOverride);
47
+ function getServiceOverride() {
48
+ return {
49
+ [IRequestService.toString()]: new SyncDescriptor(BrowserRequestService, [], true),
50
+ [IDownloadService.toString()]: new SyncDescriptor(DownloadService, [], true),
51
+ [IDecorationsService.toString()]: new SyncDescriptor(DecorationsService, [], true),
52
+ [IJSONEditingService.toString()]: new SyncDescriptor(JSONEditingService, [], true),
53
+ [ITreeViewsDnDService.toString()]: new SyncDescriptor(TreeViewsDnDService, [], true),
54
+ [IURLService.toString()]: new SyncDescriptor(BrowserURLService, [], true),
55
+ [ICanonicalUriService.toString()]: new SyncDescriptor(CanonicalUriService, [], false),
56
+ [IUserActivityService.toString()]: new SyncDescriptor(UserActivityService, [], true),
57
+ [IWorkingCopyFileService.toString()]: new SyncDescriptor(WorkingCopyFileService, [], false),
58
+ [IPathService.toString()]: new SyncDescriptor(BrowserPathServiceOverride, [], true),
59
+ [ITrustedDomainService.toString()]: new SyncDescriptor(TrustedDomainService, [], true),
60
+ [ILabelService.toString()]: new SyncDescriptor(LabelService, [], true),
61
+ [IEditorWorkerService.toString()]: new SyncDescriptor(WorkbenchEditorWorkerService, [], true)
62
+ };
63
+ }
64
+
65
+ export { getServiceOverride as default };
package/package.json CHANGED
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-base-service-override",
3
- "version": "11.1.1",
3
+ "version": "12.0.0",
4
+ "private": false,
5
+ "description": "VSCode public API plugged on the monaco editor - base service-override",
4
6
  "keywords": [],
5
7
  "author": {
6
8
  "name": "CodinGame",
@@ -12,8 +14,28 @@
12
14
  "url": "git+ssh://git@github.com/CodinGame/monaco-vscode-api.git"
13
15
  },
14
16
  "type": "module",
15
- "private": false,
16
- "description": "VSCode public API plugged on the monaco editor - base service-override",
17
+ "dependencies": {
18
+ "@codingame/monaco-vscode-039b5553-0838-562a-97c2-30d6e54a7b42-common": "12.0.0",
19
+ "@codingame/monaco-vscode-56402b83-4a60-5b15-86f9-71fe99c32744-common": "12.0.0",
20
+ "@codingame/monaco-vscode-82e231ca-6ed7-5920-b2b8-1874ccc0be07-common": "12.0.0",
21
+ "@codingame/monaco-vscode-9a1a5840-af83-5d07-a156-ba32a36c5c4b-common": "12.0.0",
22
+ "@codingame/monaco-vscode-9e888134-1a6f-58d9-b0e6-0fc047448366-common": "12.0.0",
23
+ "@codingame/monaco-vscode-d6e33d82-c101-549d-a885-0807ab3e0cfb-common": "12.0.0",
24
+ "@codingame/monaco-vscode-d987325e-3e05-53aa-b9ff-6f97476f64db-common": "12.0.0",
25
+ "vscode": "npm:@codingame/monaco-vscode-api@12.0.0"
26
+ },
27
+ "peerDependencies": {
28
+ "@codingame/monaco-vscode-99f24462-c56d-5407-83fb-2ea9dd33cc8c-common": "12.0.0",
29
+ "@codingame/monaco-vscode-a4683c2b-a0d2-5112-96ba-eedc605346d2-common": "12.0.0"
30
+ },
31
+ "peerDependenciesMeta": {
32
+ "@codingame/monaco-vscode-99f24462-c56d-5407-83fb-2ea9dd33cc8c-common": {
33
+ "optional": true
34
+ },
35
+ "@codingame/monaco-vscode-a4683c2b-a0d2-5112-96ba-eedc605346d2-common": {
36
+ "optional": true
37
+ }
38
+ },
17
39
  "main": "index.js",
18
40
  "module": "index.js",
19
41
  "types": "index.d.ts",
@@ -22,10 +44,12 @@
22
44
  "default": "./index.js"
23
45
  },
24
46
  "./vscode/*": {
25
- "default": "./vscode/src/*.js"
47
+ "default": "./vscode/src/*.js",
48
+ "types": "./vscode/src/*.d.ts"
49
+ },
50
+ "./*": {
51
+ "default": "./*.js",
52
+ "types": "./*.d.ts"
26
53
  }
27
- },
28
- "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@11.1.1"
30
54
  }
31
55
  }
@@ -0,0 +1,3 @@
1
+ import { CancellationToken } from "vscode/vscode/vs/base/common/cancellation";
2
+ import { IRequestContext, IRequestOptions } from "@codingame/monaco-vscode-039b5553-0838-562a-97c2-30d6e54a7b42-common/vscode/vs/base/parts/request/common/request";
3
+ export declare function request(options: IRequestOptions, token: CancellationToken, isOnline?: () => boolean): Promise<IRequestContext>;
@@ -1,8 +1,9 @@
1
+
1
2
  import { bufferToStream, VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
2
3
  import { canceled } from 'vscode/vscode/vs/base/common/errors';
3
- import { OfflineError } from 'vscode/vscode/vs/base/parts/request/common/request';
4
+ import { OfflineError } from '@codingame/monaco-vscode-039b5553-0838-562a-97c2-30d6e54a7b42-common/vscode/vs/base/parts/request/common/request';
4
5
 
5
- async function request(options, token) {
6
+ async function request(options, token, isOnline) {
6
7
  if (token.isCancellationRequested) {
7
8
  throw canceled();
8
9
  }
@@ -13,12 +14,16 @@ async function request(options, token) {
13
14
  AbortSignal.timeout(options.timeout),
14
15
  ]) : cancellation.signal;
15
16
  try {
16
- const res = await fetch(options.url || '', {
17
+ const fetchInit = {
17
18
  method: options.type || 'GET',
18
19
  headers: getRequestHeaders(options),
19
20
  body: options.data,
20
- signal,
21
- });
21
+ signal
22
+ };
23
+ if (options.disableCache) {
24
+ fetchInit.cache = 'no-store';
25
+ }
26
+ const res = await fetch(options.url || '', fetchInit);
22
27
  return {
23
28
  res: {
24
29
  statusCode: res.status,
@@ -28,7 +33,7 @@ async function request(options, token) {
28
33
  };
29
34
  }
30
35
  catch (err) {
31
- if (!navigator.onLine) {
36
+ if (!isOnline()) {
32
37
  throw ( new OfflineError());
33
38
  }
34
39
  if (err?.name === 'AbortError') {
@@ -0,0 +1,12 @@
1
+ import { CancellationToken } from "vscode/vscode/vs/base/common/cancellation";
2
+ import { URI } from "vscode/vscode/vs/base/common/uri";
3
+ import { IDownloadService } from "vscode/vscode/vs/platform/download/common/download.service";
4
+ import { IFileService } from "vscode/vscode/vs/platform/files/common/files.service";
5
+ import { IRequestService } from "vscode/vscode/vs/platform/request/common/request.service";
6
+ export declare class DownloadService implements IDownloadService {
7
+ private readonly requestService;
8
+ private readonly fileService;
9
+ readonly _serviceBrand: undefined;
10
+ constructor(requestService: IRequestService, fileService: IFileService);
11
+ download(resource: URI, target: URI, cancellationToken?: CancellationToken): Promise<void>;
12
+ }
@@ -1,4 +1,5 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
3
4
  import { Schemas } from 'vscode/vscode/vs/base/common/network';
4
5
  import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
@@ -0,0 +1,22 @@
1
+ import { CancellationToken } from "vscode/vscode/vs/base/common/cancellation";
2
+ import { Event } from "vscode/vscode/vs/base/common/event";
3
+ import { IChannel, IServerChannel } from "vscode/vscode/vs/base/parts/ipc/common/ipc";
4
+ import { IRequestContext, IRequestOptions } from "@codingame/monaco-vscode-039b5553-0838-562a-97c2-30d6e54a7b42-common/vscode/vs/base/parts/request/common/request";
5
+ import { AuthInfo, Credentials } from "vscode/vscode/vs/platform/request/common/request";
6
+ import { IRequestService } from "vscode/vscode/vs/platform/request/common/request.service";
7
+ export declare class RequestChannel implements IServerChannel {
8
+ private readonly service;
9
+ constructor(service: IRequestService);
10
+ listen(context: any, event: string): Event<any>;
11
+ call(context: any, command: string, args?: any, token?: CancellationToken): Promise<any>;
12
+ }
13
+ export declare class RequestChannelClient implements IRequestService {
14
+ private readonly channel;
15
+ readonly _serviceBrand: undefined;
16
+ constructor(channel: IChannel);
17
+ request(options: IRequestOptions, token: CancellationToken): Promise<IRequestContext>;
18
+ resolveProxy(url: string): Promise<string | undefined>;
19
+ lookupAuthorization(authInfo: AuthInfo): Promise<Credentials | undefined>;
20
+ lookupKerberosAuthorization(url: string): Promise<string | undefined>;
21
+ loadCertificates(): Promise<string[]>;
22
+ }
@@ -1,3 +1,4 @@
1
+
1
2
  import { bufferToStream } from 'vscode/vscode/vs/base/common/buffer';
2
3
  import 'vscode/vscode/vs/base/common/cancellation';
3
4
 
@@ -0,0 +1,17 @@
1
+ import { Disposable, IDisposable } from "vscode/vscode/vs/base/common/lifecycle";
2
+ import { URI, UriComponents } from "vscode/vscode/vs/base/common/uri";
3
+ import { IProductService } from "vscode/vscode/vs/platform/product/common/productService.service";
4
+ import { IOpenURLOptions, IURLHandler } from "vscode/vscode/vs/platform/url/common/url";
5
+ import { IURLService } from "vscode/vscode/vs/platform/url/common/url.service";
6
+ export declare abstract class AbstractURLService extends Disposable implements IURLService {
7
+ readonly _serviceBrand: undefined;
8
+ private handlers;
9
+ abstract create(options?: Partial<UriComponents>): URI;
10
+ open(uri: URI, options?: IOpenURLOptions): Promise<boolean>;
11
+ registerHandler(handler: IURLHandler): IDisposable;
12
+ }
13
+ export declare class NativeURLService extends AbstractURLService {
14
+ protected readonly productService: IProductService;
15
+ constructor(productService: IProductService);
16
+ create(options?: Partial<UriComponents>): URI;
17
+ }
@@ -1,5 +1,8 @@
1
+
1
2
  import { first } from 'vscode/vscode/vs/base/common/async';
2
3
  import { Disposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
+ import 'vscode/vscode/vs/base/common/charCode';
5
+ import 'vscode/vscode/vs/base/common/marshallingIds';
3
6
  import 'vscode/vscode/vs/base/common/path';
4
7
  import 'vscode/vscode/vs/base/common/platform';
5
8
  import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
@@ -0,0 +1,9 @@
1
+ import { EditorWorkerService } from "vscode/vscode/vs/editor/browser/services/editorWorkerService";
2
+ import { ILanguageConfigurationService } from "vscode/vscode/vs/editor/common/languages/languageConfigurationRegistry";
3
+ import { ILanguageFeaturesService } from "vscode/vscode/vs/editor/common/services/languageFeatures";
4
+ import { IModelService } from "vscode/vscode/vs/editor/common/services/model";
5
+ import { ITextResourceConfigurationService } from "vscode/vscode/vs/editor/common/services/textResourceConfiguration";
6
+ import { ILogService } from "vscode/vscode/vs/platform/log/common/log.service";
7
+ export declare class WorkbenchEditorWorkerService extends EditorWorkerService {
8
+ constructor(modelService: IModelService, configurationService: ITextResourceConfigurationService, logService: ILogService, languageConfigurationService: ILanguageConfigurationService, languageFeaturesService: ILanguageFeaturesService);
9
+ }
@@ -1,4 +1,5 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { WorkerDescriptor } from 'vscode/vscode/vs/base/browser/defaultWorkerFactory';
3
4
  import { EditorWorkerService } from 'vscode/vscode/vs/editor/browser/services/editorWorkerService';
4
5
  import { ILanguageConfigurationService } from 'vscode/vscode/vs/editor/common/languages/languageConfigurationRegistry';
@@ -0,0 +1,24 @@
1
+ import { URI } from "vscode/vscode/vs/base/common/uri";
2
+ import { ITextFileService } from "vscode/vscode/vs/workbench/services/textfile/common/textfiles.service";
3
+ import { IFileService } from "vscode/vscode/vs/platform/files/common/files.service";
4
+ import { ITextModelService } from "vscode/vscode/vs/editor/common/services/resolverService";
5
+ import { IJSONValue } from "@codingame/monaco-vscode-d987325e-3e05-53aa-b9ff-6f97476f64db-common/vscode/vs/workbench/services/configuration/common/jsonEditing";
6
+ import { IJSONEditingService } from "vscode/vscode/vs/workbench/services/configuration/common/jsonEditing.service";
7
+ export declare class JSONEditingService implements IJSONEditingService {
8
+ private readonly fileService;
9
+ private readonly textModelResolverService;
10
+ private readonly textFileService;
11
+ _serviceBrand: undefined;
12
+ private queue;
13
+ constructor(fileService: IFileService, textModelResolverService: ITextModelService, textFileService: ITextFileService);
14
+ write(resource: URI, values: IJSONValue[]): Promise<void>;
15
+ private doWriteConfiguration;
16
+ private writeToBuffer;
17
+ private applyEditsToBuffer;
18
+ private getEdits;
19
+ private resolveModelReference;
20
+ private hasParseErrors;
21
+ private resolveAndValidate;
22
+ private reject;
23
+ private toErrorMessage;
24
+ }
@@ -1,7 +1,8 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { localize } from 'vscode/vscode/vs/nls';
3
4
  import { parse } from 'vscode/vscode/vs/base/common/json';
4
- import { setProperty } from 'vscode/vscode/vs/base/common/jsonEdit';
5
+ import { setProperty } from '@codingame/monaco-vscode-56402b83-4a60-5b15-86f9-71fe99c32744-common/vscode/vs/base/common/jsonEdit';
5
6
  import { Queue } from 'vscode/vscode/vs/base/common/async';
6
7
  import { EditOperation } from 'vscode/vscode/vs/editor/common/core/editOperation';
7
8
  import { Range } from 'vscode/vscode/vs/editor/common/core/range';
@@ -9,15 +10,16 @@ import { Selection } from 'vscode/vscode/vs/editor/common/core/selection';
9
10
  import { ITextFileService } from 'vscode/vscode/vs/workbench/services/textfile/common/textfiles.service';
10
11
  import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
11
12
  import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
12
- import { JSONEditingError } from './jsonEditing.js';
13
+ import { JSONEditingErrorCode, JSONEditingError } from '@codingame/monaco-vscode-d987325e-3e05-53aa-b9ff-6f97476f64db-common/vscode/vs/workbench/services/configuration/common/jsonEditing';
13
14
  import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
15
+ import 'vscode/vscode/vs/platform/instantiation/common/extensions';
14
16
 
15
17
  let JSONEditingService = class JSONEditingService {
16
18
  constructor(fileService, textModelResolverService, textFileService) {
17
19
  this.fileService = fileService;
18
20
  this.textModelResolverService = textModelResolverService;
19
21
  this.textFileService = textFileService;
20
- this.queue = ( (new Queue()));
22
+ this.queue = ( new Queue());
21
23
  }
22
24
  write(resource, values) {
23
25
  return Promise.resolve(this.queue.queue(() => this.doWriteConfiguration(resource, values)));
@@ -44,21 +46,21 @@ let JSONEditingService = class JSONEditingService {
44
46
  applyEditsToBuffer(edit, model) {
45
47
  const startPosition = model.getPositionAt(edit.offset);
46
48
  const endPosition = model.getPositionAt(edit.offset + edit.length);
47
- const range = ( (new Range(
49
+ const range = ( new Range(
48
50
  startPosition.lineNumber,
49
51
  startPosition.column,
50
52
  endPosition.lineNumber,
51
53
  endPosition.column
52
- )));
54
+ ));
53
55
  const currentText = model.getValueInRange(range);
54
56
  if (edit.content !== currentText) {
55
57
  const editOperation = currentText ? EditOperation.replace(range, edit.content) : EditOperation.insert(startPosition, edit.content);
56
- model.pushEditOperations([( (new Selection(
58
+ model.pushEditOperations([( new Selection(
57
59
  startPosition.lineNumber,
58
60
  startPosition.column,
59
61
  startPosition.lineNumber,
60
62
  startPosition.column
61
- )))], [editOperation], () => []);
63
+ ))], [editOperation], () => []);
62
64
  return true;
63
65
  }
64
66
  return false;
@@ -94,29 +96,29 @@ let JSONEditingService = class JSONEditingService {
94
96
  const model = reference.object.textEditorModel;
95
97
  if (this.hasParseErrors(model)) {
96
98
  reference.dispose();
97
- return this.reject(0 );
99
+ return this.reject(JSONEditingErrorCode.ERROR_INVALID_FILE);
98
100
  }
99
101
  return reference;
100
102
  }
101
103
  reject(code) {
102
104
  const message = this.toErrorMessage(code);
103
- return Promise.reject(( (new JSONEditingError(message, code))));
105
+ return Promise.reject(( new JSONEditingError(message, code)));
104
106
  }
105
107
  toErrorMessage(error) {
106
108
  switch (error) {
107
- case 0 : {
108
- return ( localize(
109
- 1036,
109
+ case JSONEditingErrorCode.ERROR_INVALID_FILE: {
110
+ return localize(
111
+ 11304,
110
112
  "Unable to write into the file. Please open the file to correct errors/warnings in the file and try again."
111
- ));
113
+ );
112
114
  }
113
115
  }
114
116
  }
115
117
  };
116
- JSONEditingService = ( (__decorate([
117
- ( (__param(0, IFileService))),
118
- ( (__param(1, ITextModelService))),
119
- ( (__param(2, ITextFileService)))
120
- ], JSONEditingService)));
118
+ JSONEditingService = ( __decorate([
119
+ ( __param(0, IFileService)),
120
+ ( __param(1, ITextModelService)),
121
+ ( __param(2, ITextFileService))
122
+ ], JSONEditingService));
121
123
 
122
124
  export { JSONEditingService };
@@ -0,0 +1,24 @@
1
+ import { URI } from "vscode/vscode/vs/base/common/uri";
2
+ import { Event } from "vscode/vscode/vs/base/common/event";
3
+ import { IDecoration, IResourceDecorationChangeEvent, IDecorationsProvider } from "vscode/vscode/vs/workbench/services/decorations/common/decorations";
4
+ import { IDecorationsService } from "vscode/vscode/vs/workbench/services/decorations/common/decorations.service";
5
+ import { IDisposable } from "vscode/vscode/vs/base/common/lifecycle";
6
+ import { IThemeService } from "vscode/vscode/vs/platform/theme/common/themeService.service";
7
+ import { IUriIdentityService } from "vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service";
8
+ export declare class DecorationsService implements IDecorationsService {
9
+ _serviceBrand: undefined;
10
+ private readonly _store;
11
+ private readonly _onDidChangeDecorationsDelayed;
12
+ private readonly _onDidChangeDecorations;
13
+ onDidChangeDecorations: Event<IResourceDecorationChangeEvent>;
14
+ private readonly _provider;
15
+ private readonly _decorationStyles;
16
+ private readonly _data;
17
+ constructor(uriIdentityService: IUriIdentityService, themeService: IThemeService);
18
+ dispose(): void;
19
+ registerDecorationsProvider(provider: IDecorationsProvider): IDisposable;
20
+ private _ensureEntry;
21
+ getDecoration(uri: URI, includeChildren: boolean): IDecoration | undefined;
22
+ private _fetchData;
23
+ private _keepItem;
24
+ }
@@ -1,18 +1,20 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { DebounceEmitter, Emitter } from 'vscode/vscode/vs/base/common/event';
3
4
  import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
4
5
  import { TernarySearchTree } from 'vscode/vscode/vs/base/common/ternarySearchTree';
5
6
  import { DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
6
7
  import { isThenable } from 'vscode/vscode/vs/base/common/async';
7
8
  import { LinkedList } from 'vscode/vscode/vs/base/common/linkedList';
8
- import { createCSSRule, removeCSSRulesContainingSelector, createStyleSheet } from 'vscode/vscode/vs/base/browser/dom';
9
- import { asCSSPropertyValue } from 'vscode/vscode/vs/base/browser/cssValue';
9
+ import { createCSSRule, removeCSSRulesContainingSelector, createStyleSheet } from 'vscode/vscode/vs/base/browser/domStylesheets';
10
+ import { stringValue } from 'vscode/vscode/vs/base/browser/cssValue';
10
11
  import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
11
12
  import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
12
13
  import { isFalsyOrWhitespace } from 'vscode/vscode/vs/base/common/strings';
13
14
  import { localize } from 'vscode/vscode/vs/nls';
14
15
  import { isCancellationError } from 'vscode/vscode/vs/base/common/errors';
15
16
  import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
17
+ import 'vscode/vscode/vs/platform/instantiation/common/extensions';
16
18
  import { hash } from 'vscode/vscode/vs/base/common/hash';
17
19
  import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
18
20
  import { distinct, asArray } from 'vscode/vscode/vs/base/common/arrays';
@@ -32,7 +34,7 @@ import { getIconRegistry } from 'vscode/vscode/vs/platform/theme/common/iconRegi
32
34
  class DecorationRule {
33
35
  static keyOf(data) {
34
36
  if (Array.isArray(data)) {
35
- return ( (data.map(DecorationRule.keyOf))).join(',');
37
+ return ( data.map(DecorationRule.keyOf)).join(',');
36
38
  }
37
39
  else {
38
40
  const { color, letter } = data;
@@ -49,7 +51,7 @@ class DecorationRule {
49
51
  this.themeService = themeService;
50
52
  this._refCounter = 0;
51
53
  this.data = data;
52
- const suffix = ( (hash(key).toString(36)));
54
+ const suffix = ( hash(key).toString(36));
53
55
  this.itemColorClassName = `${DecorationRule._classNamesPrefix}-itemColor-${suffix}`;
54
56
  this.itemBadgeClassName = `${DecorationRule._classNamesPrefix}-itemBadge-${suffix}`;
55
57
  this.bubbleBadgeClassName = `${DecorationRule._classNamesPrefix}-bubbleBadge-${suffix}`;
@@ -118,7 +120,7 @@ class DecorationRule {
118
120
  }
119
121
  createCSSRule(`.${this.iconBadgeClassName}::after`, `content: '${definition.fontCharacter}';
120
122
  color: ${icon.color ? getColor(icon.color.id) : getColor(color)};
121
- font-family: ${asCSSPropertyValue(definition.font?.id ?? 'codicon')};
123
+ font-family: ${stringValue(definition.font?.id ?? 'codicon')};
122
124
  font-size: 16px;
123
125
  margin-right: 14px;
124
126
  font-weight: normal;
@@ -135,9 +137,9 @@ class DecorationRule {
135
137
  class DecorationStyles {
136
138
  constructor(_themeService) {
137
139
  this._themeService = _themeService;
138
- this._dispoables = ( (new DisposableStore()));
140
+ this._dispoables = ( new DisposableStore());
139
141
  this._styleElement = createStyleSheet(undefined, undefined, this._dispoables);
140
- this._decorationRules = ( (new Map()));
142
+ this._decorationRules = ( new Map());
141
143
  }
142
144
  dispose() {
143
145
  this._dispoables.dispose();
@@ -147,7 +149,7 @@ class DecorationStyles {
147
149
  const key = DecorationRule.keyOf(data);
148
150
  let rule = this._decorationRules.get(key);
149
151
  if (!rule) {
150
- rule = ( (new DecorationRule(this._themeService, data, key)));
152
+ rule = ( new DecorationRule(this._themeService, data, key));
151
153
  this._decorationRules.set(key, rule);
152
154
  rule.appendCSSRules(this._styleElement);
153
155
  }
@@ -155,11 +157,11 @@ class DecorationStyles {
155
157
  const labelClassName = rule.itemColorClassName;
156
158
  let badgeClassName = rule.itemBadgeClassName;
157
159
  const iconClassName = rule.iconBadgeClassName;
158
- let tooltip = distinct(( (data.filter(d => !isFalsyOrWhitespace(d.tooltip)).map(d => d.tooltip)))).join(' • ');
159
- const strikethrough = ( (data.some(d => d.strikethrough)));
160
+ let tooltip = distinct(( data.filter(d => !isFalsyOrWhitespace(d.tooltip)).map(d => d.tooltip))).join(' • ');
161
+ const strikethrough = ( data.some(d => d.strikethrough));
160
162
  if (onlyChildren) {
161
163
  badgeClassName = rule.bubbleBadgeClassName;
162
- tooltip = ( localize(1037, "Contains emphasized items"));
164
+ tooltip = ( localize(11342, "Contains emphasized items"));
163
165
  }
164
166
  return {
165
167
  labelClassName,
@@ -197,14 +199,14 @@ function getColor(color) {
197
199
  }
198
200
  let DecorationsService = class DecorationsService {
199
201
  constructor(uriIdentityService, themeService) {
200
- this._store = ( (new DisposableStore()));
201
- this._onDidChangeDecorationsDelayed = this._store.add(( (new DebounceEmitter({ merge: all => all.flat() }))));
202
- this._onDidChangeDecorations = this._store.add(( (new Emitter())));
202
+ this._store = ( new DisposableStore());
203
+ this._onDidChangeDecorationsDelayed = this._store.add(( new DebounceEmitter({ merge: all => all.flat() })));
204
+ this._onDidChangeDecorations = this._store.add(( new Emitter()));
203
205
  this.onDidChangeDecorations = this._onDidChangeDecorations.event;
204
- this._provider = ( (new LinkedList()));
205
- this._decorationStyles = ( (new DecorationStyles(themeService)));
206
+ this._provider = ( new LinkedList());
207
+ this._decorationStyles = ( new DecorationStyles(themeService));
206
208
  this._data = TernarySearchTree.forUris(key => uriIdentityService.extUri.ignorePathCasing(key));
207
- this._store.add(this._onDidChangeDecorationsDelayed.event(event => { this._onDidChangeDecorations.fire(( (new FileDecorationChangeEvent(event)))); }));
209
+ this._store.add(this._onDidChangeDecorationsDelayed.event(event => { this._onDidChangeDecorations.fire(( new FileDecorationChangeEvent(event))); }));
208
210
  }
209
211
  dispose() {
210
212
  this._store.dispose();
@@ -246,7 +248,7 @@ let DecorationsService = class DecorationsService {
246
248
  _ensureEntry(uri) {
247
249
  let map = this._data.get(uri);
248
250
  if (!map) {
249
- map = ( (new Map()));
251
+ map = ( new Map());
250
252
  this._data.set(uri, map);
251
253
  }
252
254
  return map;
@@ -268,7 +270,7 @@ let DecorationsService = class DecorationsService {
268
270
  const iter = this._data.findSuperstr(uri);
269
271
  if (iter) {
270
272
  for (const tuple of iter) {
271
- for (const data of ( (tuple[1].values()))) {
273
+ for (const data of ( tuple[1].values())) {
272
274
  if (data && !(data instanceof DecorationDataRequest)) {
273
275
  if (data.bubble) {
274
276
  all.push(data);
@@ -289,14 +291,14 @@ let DecorationsService = class DecorationsService {
289
291
  pendingRequest.source.cancel();
290
292
  map.delete(provider);
291
293
  }
292
- const cts = ( (new CancellationTokenSource()));
294
+ const cts = ( new CancellationTokenSource());
293
295
  const dataOrThenable = provider.provideDecorations(uri, cts.token);
294
296
  if (!isThenable(dataOrThenable)) {
295
297
  cts.dispose();
296
298
  return this._keepItem(map, provider, uri, dataOrThenable);
297
299
  }
298
300
  else {
299
- const request = ( (new DecorationDataRequest(cts, Promise.resolve(dataOrThenable).then(data => {
301
+ const request = ( new DecorationDataRequest(cts, Promise.resolve(dataOrThenable).then(data => {
300
302
  if (map.get(provider) === request) {
301
303
  this._keepItem(map, provider, uri, data);
302
304
  }
@@ -306,7 +308,7 @@ let DecorationsService = class DecorationsService {
306
308
  }
307
309
  }).finally(() => {
308
310
  cts.dispose();
309
- }))));
311
+ })));
310
312
  map.set(provider, request);
311
313
  return null;
312
314
  }
@@ -321,9 +323,9 @@ let DecorationsService = class DecorationsService {
321
323
  return deco;
322
324
  }
323
325
  };
324
- DecorationsService = ( (__decorate([
325
- ( (__param(0, IUriIdentityService))),
326
- ( (__param(1, IThemeService)))
327
- ], DecorationsService)));
326
+ DecorationsService = ( __decorate([
327
+ ( __param(0, IUriIdentityService)),
328
+ ( __param(1, IThemeService))
329
+ ], DecorationsService));
328
330
 
329
331
  export { DecorationsService };