@theia/preferences 1.34.3 → 1.34.4

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 (128) hide show
  1. package/LICENSE +641 -641
  2. package/README.md +81 -81
  3. package/lib/browser/abstract-resource-preference-provider.d.ts +46 -46
  4. package/lib/browser/abstract-resource-preference-provider.js +237 -237
  5. package/lib/browser/abstract-resource-preference-provider.spec.d.ts +1 -1
  6. package/lib/browser/abstract-resource-preference-provider.spec.js +83 -83
  7. package/lib/browser/folder-preference-provider.d.ts +20 -20
  8. package/lib/browser/folder-preference-provider.js +59 -59
  9. package/lib/browser/folders-preferences-provider.d.ts +25 -25
  10. package/lib/browser/folders-preferences-provider.js +239 -239
  11. package/lib/browser/index.d.ts +7 -7
  12. package/lib/browser/index.js +34 -34
  13. package/lib/browser/monaco-jsonc-editor.d.ts +9 -9
  14. package/lib/browser/monaco-jsonc-editor.js +80 -80
  15. package/lib/browser/package.spec.js +25 -25
  16. package/lib/browser/preference-bindings.d.ts +4 -4
  17. package/lib/browser/preference-bindings.js +63 -63
  18. package/lib/browser/preference-frontend-module.d.ts +6 -6
  19. package/lib/browser/preference-frontend-module.js +52 -52
  20. package/lib/browser/preference-open-handler.d.ts +9 -9
  21. package/lib/browser/preference-open-handler.js +64 -64
  22. package/lib/browser/preference-transaction-manager.d.ts +98 -98
  23. package/lib/browser/preference-transaction-manager.js +295 -295
  24. package/lib/browser/preference-tree-model.d.ts +59 -59
  25. package/lib/browser/preference-tree-model.js +240 -240
  26. package/lib/browser/preferences-contribution.d.ts +37 -37
  27. package/lib/browser/preferences-contribution.js +279 -279
  28. package/lib/browser/preferences-json-schema-contribution.d.ts +17 -17
  29. package/lib/browser/preferences-json-schema-contribution.js +91 -91
  30. package/lib/browser/preferences-monaco-contribution.d.ts +1 -1
  31. package/lib/browser/preferences-monaco-contribution.js +30 -30
  32. package/lib/browser/section-preference-provider.d.ts +21 -21
  33. package/lib/browser/section-preference-provider.js +96 -96
  34. package/lib/browser/user-configs-preference-provider.d.ts +21 -21
  35. package/lib/browser/user-configs-preference-provider.js +134 -134
  36. package/lib/browser/user-preference-provider.d.ts +13 -13
  37. package/lib/browser/user-preference-provider.js +41 -41
  38. package/lib/browser/util/preference-scope-command-manager.d.ts +17 -17
  39. package/lib/browser/util/preference-scope-command-manager.js +87 -87
  40. package/lib/browser/util/preference-tree-generator.d.ts +30 -30
  41. package/lib/browser/util/preference-tree-generator.js +234 -234
  42. package/lib/browser/util/preference-tree-label-provider.d.ts +11 -11
  43. package/lib/browser/util/preference-tree-label-provider.js +77 -77
  44. package/lib/browser/util/preference-tree-label-provider.spec.d.ts +1 -1
  45. package/lib/browser/util/preference-tree-label-provider.spec.js +87 -87
  46. package/lib/browser/util/preference-types.d.ts +62 -62
  47. package/lib/browser/util/preference-types.js +128 -128
  48. package/lib/browser/views/components/preference-array-input.d.ts +28 -28
  49. package/lib/browser/views/components/preference-array-input.js +180 -180
  50. package/lib/browser/views/components/preference-boolean-input.d.ts +17 -17
  51. package/lib/browser/views/components/preference-boolean-input.js +79 -79
  52. package/lib/browser/views/components/preference-file-input.d.ts +29 -29
  53. package/lib/browser/views/components/preference-file-input.js +110 -110
  54. package/lib/browser/views/components/preference-json-input.d.ts +19 -19
  55. package/lib/browser/views/components/preference-json-input.js +93 -93
  56. package/lib/browser/views/components/preference-node-renderer-creator.d.ts +48 -48
  57. package/lib/browser/views/components/preference-node-renderer-creator.js +132 -132
  58. package/lib/browser/views/components/preference-node-renderer.d.ts +111 -111
  59. package/lib/browser/views/components/preference-node-renderer.js +460 -460
  60. package/lib/browser/views/components/preference-number-input.d.ts +34 -34
  61. package/lib/browser/views/components/preference-number-input.js +142 -142
  62. package/lib/browser/views/components/preference-select-input.d.ts +27 -27
  63. package/lib/browser/views/components/preference-select-input.js +135 -135
  64. package/lib/browser/views/components/preference-string-input.d.ts +17 -17
  65. package/lib/browser/views/components/preference-string-input.js +89 -89
  66. package/lib/browser/views/preference-editor-widget.d.ts +67 -67
  67. package/lib/browser/views/preference-editor-widget.js +376 -376
  68. package/lib/browser/views/preference-scope-tabbar-widget.d.ts +54 -54
  69. package/lib/browser/views/preference-scope-tabbar-widget.js +343 -343
  70. package/lib/browser/views/preference-searchbar-widget.d.ts +53 -53
  71. package/lib/browser/views/preference-searchbar-widget.js +173 -173
  72. package/lib/browser/views/preference-tree-widget.d.ts +17 -17
  73. package/lib/browser/views/preference-tree-widget.js +104 -104
  74. package/lib/browser/views/preference-widget-bindings.d.ts +3 -3
  75. package/lib/browser/views/preference-widget-bindings.js +85 -85
  76. package/lib/browser/views/preference-widget.d.ts +35 -35
  77. package/lib/browser/views/preference-widget.js +123 -123
  78. package/lib/browser/workspace-file-preference-provider.d.ts +23 -23
  79. package/lib/browser/workspace-file-preference-provider.js +110 -110
  80. package/lib/browser/workspace-preference-provider.d.ts +28 -28
  81. package/lib/browser/workspace-preference-provider.js +142 -142
  82. package/package.json +9 -9
  83. package/src/browser/abstract-resource-preference-provider.spec.ts +95 -95
  84. package/src/browser/abstract-resource-preference-provider.ts +228 -228
  85. package/src/browser/folder-preference-provider.ts +58 -58
  86. package/src/browser/folders-preferences-provider.ts +236 -236
  87. package/src/browser/index.ts +23 -23
  88. package/src/browser/monaco-jsonc-editor.ts +67 -67
  89. package/src/browser/package.spec.ts +28 -28
  90. package/src/browser/preference-bindings.ts +65 -65
  91. package/src/browser/preference-frontend-module.ts +57 -57
  92. package/src/browser/preference-open-handler.ts +53 -53
  93. package/src/browser/preference-transaction-manager.ts +283 -283
  94. package/src/browser/preference-tree-model.ts +246 -246
  95. package/src/browser/preferences-contribution.ts +263 -263
  96. package/src/browser/preferences-json-schema-contribution.ts +86 -86
  97. package/src/browser/preferences-monaco-contribution.ts +30 -30
  98. package/src/browser/section-preference-provider.ts +83 -83
  99. package/src/browser/style/index.css +456 -456
  100. package/src/browser/style/preference-array.css +90 -90
  101. package/src/browser/style/preference-context-menu.css +74 -74
  102. package/src/browser/style/preference-file.css +32 -32
  103. package/src/browser/style/preference-object.css +49 -49
  104. package/src/browser/style/search-input.css +66 -66
  105. package/src/browser/user-configs-preference-provider.ts +123 -123
  106. package/src/browser/user-preference-provider.ts +35 -35
  107. package/src/browser/util/preference-scope-command-manager.ts +75 -75
  108. package/src/browser/util/preference-tree-generator.ts +222 -222
  109. package/src/browser/util/preference-tree-label-provider.spec.ts +108 -108
  110. package/src/browser/util/preference-tree-label-provider.ts +64 -64
  111. package/src/browser/util/preference-types.ts +169 -169
  112. package/src/browser/views/components/preference-array-input.ts +174 -174
  113. package/src/browser/views/components/preference-boolean-input.ts +69 -69
  114. package/src/browser/views/components/preference-file-input.ts +104 -104
  115. package/src/browser/views/components/preference-json-input.ts +78 -78
  116. package/src/browser/views/components/preference-node-renderer-creator.ts +141 -141
  117. package/src/browser/views/components/preference-node-renderer.ts +499 -499
  118. package/src/browser/views/components/preference-number-input.ts +147 -147
  119. package/src/browser/views/components/preference-select-input.ts +127 -127
  120. package/src/browser/views/components/preference-string-input.ts +76 -76
  121. package/src/browser/views/preference-editor-widget.ts +361 -361
  122. package/src/browser/views/preference-scope-tabbar-widget.tsx +344 -344
  123. package/src/browser/views/preference-searchbar-widget.tsx +183 -183
  124. package/src/browser/views/preference-tree-widget.tsx +93 -93
  125. package/src/browser/views/preference-widget-bindings.ts +99 -99
  126. package/src/browser/views/preference-widget.tsx +113 -113
  127. package/src/browser/workspace-file-preference-provider.ts +100 -100
  128. package/src/browser/workspace-preference-provider.ts +134 -134
@@ -1,18 +1,18 @@
1
- import { InMemoryResources } from '@theia/core';
2
- import { JsonSchemaRegisterContext, JsonSchemaContribution } from '@theia/core/lib/browser/json-schema-store';
3
- import { PreferenceSchemaProvider } from '@theia/core/lib/browser/preferences/preference-contribution';
4
- import { PreferenceConfigurations } from '@theia/core/lib/browser/preferences/preference-configurations';
5
- import { WorkspaceService } from '@theia/workspace/lib/browser';
6
- export declare class PreferencesJsonSchemaContribution implements JsonSchemaContribution {
7
- private serializeSchema;
8
- protected readonly schemaProvider: PreferenceSchemaProvider;
9
- protected readonly inmemoryResources: InMemoryResources;
10
- protected readonly preferenceConfigurations: PreferenceConfigurations;
11
- protected readonly workspaceService: WorkspaceService;
12
- registerSchemas(context: JsonSchemaRegisterContext): void;
13
- private registerSchema;
14
- private updateInMemoryResources;
15
- private getSchemaURIForScope;
16
- private getFileMatch;
17
- }
1
+ import { InMemoryResources } from '@theia/core';
2
+ import { JsonSchemaRegisterContext, JsonSchemaContribution } from '@theia/core/lib/browser/json-schema-store';
3
+ import { PreferenceSchemaProvider } from '@theia/core/lib/browser/preferences/preference-contribution';
4
+ import { PreferenceConfigurations } from '@theia/core/lib/browser/preferences/preference-configurations';
5
+ import { WorkspaceService } from '@theia/workspace/lib/browser';
6
+ export declare class PreferencesJsonSchemaContribution implements JsonSchemaContribution {
7
+ private serializeSchema;
8
+ protected readonly schemaProvider: PreferenceSchemaProvider;
9
+ protected readonly inmemoryResources: InMemoryResources;
10
+ protected readonly preferenceConfigurations: PreferenceConfigurations;
11
+ protected readonly workspaceService: WorkspaceService;
12
+ registerSchemas(context: JsonSchemaRegisterContext): void;
13
+ private registerSchema;
14
+ private updateInMemoryResources;
15
+ private getSchemaURIForScope;
16
+ private getFileMatch;
17
+ }
18
18
  //# sourceMappingURL=preferences-json-schema-contribution.d.ts.map
@@ -1,92 +1,92 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2018 TypeFox and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
- return c > 3 && r && Object.defineProperty(target, key, r), r;
22
- };
23
- var __metadata = (this && this.__metadata) || function (k, v) {
24
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
- };
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.PreferencesJsonSchemaContribution = void 0;
28
- const inversify_1 = require("@theia/core/shared/inversify");
29
- const uri_1 = require("@theia/core/lib/common/uri");
30
- const core_1 = require("@theia/core");
31
- const preference_contribution_1 = require("@theia/core/lib/browser/preferences/preference-contribution");
32
- const preference_configurations_1 = require("@theia/core/lib/browser/preferences/preference-configurations");
33
- const browser_1 = require("@theia/core/lib/browser");
34
- const browser_2 = require("@theia/workspace/lib/browser");
35
- const PREFERENCE_URI_PREFIX = 'vscode://schemas/settings/';
36
- const USER_STORAGE_PREFIX = 'user-storage:/';
37
- let PreferencesJsonSchemaContribution = class PreferencesJsonSchemaContribution {
38
- constructor() {
39
- this.serializeSchema = (scope) => JSON.stringify(this.schemaProvider.getSchema(scope));
40
- }
41
- registerSchemas(context) {
42
- this.registerSchema(browser_1.PreferenceScope.Default, context);
43
- this.registerSchema(browser_1.PreferenceScope.User, context);
44
- this.registerSchema(browser_1.PreferenceScope.Workspace, context);
45
- this.registerSchema(browser_1.PreferenceScope.Folder, context);
46
- this.workspaceService.updateSchema('settings', { $ref: this.getSchemaURIForScope(browser_1.PreferenceScope.Workspace).toString() });
47
- this.schemaProvider.onDidPreferenceSchemaChanged(() => this.updateInMemoryResources());
48
- }
49
- registerSchema(scope, context) {
50
- const scopeStr = browser_1.PreferenceScope[scope].toLowerCase();
51
- const uri = new uri_1.default(PREFERENCE_URI_PREFIX + scopeStr);
52
- this.inmemoryResources.add(uri, this.serializeSchema(scope));
53
- context.registerSchema({
54
- fileMatch: this.getFileMatch(scopeStr),
55
- url: uri.toString()
56
- });
57
- }
58
- updateInMemoryResources() {
59
- this.inmemoryResources.update(this.getSchemaURIForScope(browser_1.PreferenceScope.Default), this.serializeSchema(+browser_1.PreferenceScope.Default));
60
- this.inmemoryResources.update(this.getSchemaURIForScope(browser_1.PreferenceScope.User), this.serializeSchema(+browser_1.PreferenceScope.User));
61
- this.inmemoryResources.update(this.getSchemaURIForScope(browser_1.PreferenceScope.Workspace), this.serializeSchema(+browser_1.PreferenceScope.Workspace));
62
- this.inmemoryResources.update(this.getSchemaURIForScope(browser_1.PreferenceScope.Folder), this.serializeSchema(+browser_1.PreferenceScope.Folder));
63
- }
64
- getSchemaURIForScope(scope) {
65
- return new uri_1.default(PREFERENCE_URI_PREFIX + browser_1.PreferenceScope[scope].toLowerCase());
66
- }
67
- getFileMatch(scope) {
68
- const baseName = this.preferenceConfigurations.getConfigName() + '.json';
69
- return [baseName, new uri_1.default(USER_STORAGE_PREFIX + scope).resolve(baseName).toString()];
70
- }
71
- };
72
- __decorate([
73
- (0, inversify_1.inject)(preference_contribution_1.PreferenceSchemaProvider),
74
- __metadata("design:type", preference_contribution_1.PreferenceSchemaProvider)
75
- ], PreferencesJsonSchemaContribution.prototype, "schemaProvider", void 0);
76
- __decorate([
77
- (0, inversify_1.inject)(core_1.InMemoryResources),
78
- __metadata("design:type", core_1.InMemoryResources)
79
- ], PreferencesJsonSchemaContribution.prototype, "inmemoryResources", void 0);
80
- __decorate([
81
- (0, inversify_1.inject)(preference_configurations_1.PreferenceConfigurations),
82
- __metadata("design:type", preference_configurations_1.PreferenceConfigurations)
83
- ], PreferencesJsonSchemaContribution.prototype, "preferenceConfigurations", void 0);
84
- __decorate([
85
- (0, inversify_1.inject)(browser_2.WorkspaceService),
86
- __metadata("design:type", browser_2.WorkspaceService)
87
- ], PreferencesJsonSchemaContribution.prototype, "workspaceService", void 0);
88
- PreferencesJsonSchemaContribution = __decorate([
89
- (0, inversify_1.injectable)()
90
- ], PreferencesJsonSchemaContribution);
91
- exports.PreferencesJsonSchemaContribution = PreferencesJsonSchemaContribution;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2018 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.PreferencesJsonSchemaContribution = void 0;
28
+ const inversify_1 = require("@theia/core/shared/inversify");
29
+ const uri_1 = require("@theia/core/lib/common/uri");
30
+ const core_1 = require("@theia/core");
31
+ const preference_contribution_1 = require("@theia/core/lib/browser/preferences/preference-contribution");
32
+ const preference_configurations_1 = require("@theia/core/lib/browser/preferences/preference-configurations");
33
+ const browser_1 = require("@theia/core/lib/browser");
34
+ const browser_2 = require("@theia/workspace/lib/browser");
35
+ const PREFERENCE_URI_PREFIX = 'vscode://schemas/settings/';
36
+ const USER_STORAGE_PREFIX = 'user-storage:/';
37
+ let PreferencesJsonSchemaContribution = class PreferencesJsonSchemaContribution {
38
+ constructor() {
39
+ this.serializeSchema = (scope) => JSON.stringify(this.schemaProvider.getSchema(scope));
40
+ }
41
+ registerSchemas(context) {
42
+ this.registerSchema(browser_1.PreferenceScope.Default, context);
43
+ this.registerSchema(browser_1.PreferenceScope.User, context);
44
+ this.registerSchema(browser_1.PreferenceScope.Workspace, context);
45
+ this.registerSchema(browser_1.PreferenceScope.Folder, context);
46
+ this.workspaceService.updateSchema('settings', { $ref: this.getSchemaURIForScope(browser_1.PreferenceScope.Workspace).toString() });
47
+ this.schemaProvider.onDidPreferenceSchemaChanged(() => this.updateInMemoryResources());
48
+ }
49
+ registerSchema(scope, context) {
50
+ const scopeStr = browser_1.PreferenceScope[scope].toLowerCase();
51
+ const uri = new uri_1.default(PREFERENCE_URI_PREFIX + scopeStr);
52
+ this.inmemoryResources.add(uri, this.serializeSchema(scope));
53
+ context.registerSchema({
54
+ fileMatch: this.getFileMatch(scopeStr),
55
+ url: uri.toString()
56
+ });
57
+ }
58
+ updateInMemoryResources() {
59
+ this.inmemoryResources.update(this.getSchemaURIForScope(browser_1.PreferenceScope.Default), this.serializeSchema(+browser_1.PreferenceScope.Default));
60
+ this.inmemoryResources.update(this.getSchemaURIForScope(browser_1.PreferenceScope.User), this.serializeSchema(+browser_1.PreferenceScope.User));
61
+ this.inmemoryResources.update(this.getSchemaURIForScope(browser_1.PreferenceScope.Workspace), this.serializeSchema(+browser_1.PreferenceScope.Workspace));
62
+ this.inmemoryResources.update(this.getSchemaURIForScope(browser_1.PreferenceScope.Folder), this.serializeSchema(+browser_1.PreferenceScope.Folder));
63
+ }
64
+ getSchemaURIForScope(scope) {
65
+ return new uri_1.default(PREFERENCE_URI_PREFIX + browser_1.PreferenceScope[scope].toLowerCase());
66
+ }
67
+ getFileMatch(scope) {
68
+ const baseName = this.preferenceConfigurations.getConfigName() + '.json';
69
+ return [baseName, new uri_1.default(USER_STORAGE_PREFIX + scope).resolve(baseName).toString()];
70
+ }
71
+ };
72
+ __decorate([
73
+ (0, inversify_1.inject)(preference_contribution_1.PreferenceSchemaProvider),
74
+ __metadata("design:type", preference_contribution_1.PreferenceSchemaProvider)
75
+ ], PreferencesJsonSchemaContribution.prototype, "schemaProvider", void 0);
76
+ __decorate([
77
+ (0, inversify_1.inject)(core_1.InMemoryResources),
78
+ __metadata("design:type", core_1.InMemoryResources)
79
+ ], PreferencesJsonSchemaContribution.prototype, "inmemoryResources", void 0);
80
+ __decorate([
81
+ (0, inversify_1.inject)(preference_configurations_1.PreferenceConfigurations),
82
+ __metadata("design:type", preference_configurations_1.PreferenceConfigurations)
83
+ ], PreferencesJsonSchemaContribution.prototype, "preferenceConfigurations", void 0);
84
+ __decorate([
85
+ (0, inversify_1.inject)(browser_2.WorkspaceService),
86
+ __metadata("design:type", browser_2.WorkspaceService)
87
+ ], PreferencesJsonSchemaContribution.prototype, "workspaceService", void 0);
88
+ PreferencesJsonSchemaContribution = __decorate([
89
+ (0, inversify_1.injectable)()
90
+ ], PreferencesJsonSchemaContribution);
91
+ exports.PreferencesJsonSchemaContribution = PreferencesJsonSchemaContribution;
92
92
  //# sourceMappingURL=preferences-json-schema-contribution.js.map
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=preferences-monaco-contribution.d.ts.map
@@ -1,31 +1,31 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2018 TypeFox and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- const monaco = require("@theia/monaco-editor-core");
19
- monaco.languages.register({
20
- id: 'jsonc',
21
- 'aliases': [
22
- 'JSON with Comments'
23
- ],
24
- 'filenames': [
25
- 'settings.json'
26
- ],
27
- 'extensions': [
28
- '.theia-workspace'
29
- ]
30
- });
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2018 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const monaco = require("@theia/monaco-editor-core");
19
+ monaco.languages.register({
20
+ id: 'jsonc',
21
+ 'aliases': [
22
+ 'JSON with Comments'
23
+ ],
24
+ 'filenames': [
25
+ 'settings.json'
26
+ ],
27
+ 'extensions': [
28
+ '.theia-workspace'
29
+ ]
30
+ });
31
31
  //# sourceMappingURL=preferences-monaco-contribution.js.map
@@ -1,22 +1,22 @@
1
- import URI from '@theia/core/lib/common/uri';
2
- import { AbstractResourcePreferenceProvider } from './abstract-resource-preference-provider';
3
- import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
4
- import { PreferenceConfigurations } from '@theia/core/lib/browser/preferences/preference-configurations';
5
- export declare const SectionPreferenceProviderUri: unique symbol;
6
- export declare const SectionPreferenceProviderSection: unique symbol;
7
- /**
8
- * This class encapsulates the logic of using separate files for some workspace configuration like 'launch.json' or 'tasks.json'.
9
- * Anything that is not a contributed section will be in the main config file.
10
- */
11
- export declare abstract class SectionPreferenceProvider extends AbstractResourcePreferenceProvider {
12
- protected readonly workspaceService: WorkspaceService;
13
- protected readonly uri: URI;
14
- protected readonly section: string;
15
- protected readonly preferenceConfigurations: PreferenceConfigurations;
16
- private _isSection?;
17
- private get isSection();
18
- protected getUri(): URI;
19
- protected parse(content: string): any;
20
- protected getPath(preferenceName: string): string[] | undefined;
21
- }
1
+ import URI from '@theia/core/lib/common/uri';
2
+ import { AbstractResourcePreferenceProvider } from './abstract-resource-preference-provider';
3
+ import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
4
+ import { PreferenceConfigurations } from '@theia/core/lib/browser/preferences/preference-configurations';
5
+ export declare const SectionPreferenceProviderUri: unique symbol;
6
+ export declare const SectionPreferenceProviderSection: unique symbol;
7
+ /**
8
+ * This class encapsulates the logic of using separate files for some workspace configuration like 'launch.json' or 'tasks.json'.
9
+ * Anything that is not a contributed section will be in the main config file.
10
+ */
11
+ export declare abstract class SectionPreferenceProvider extends AbstractResourcePreferenceProvider {
12
+ protected readonly workspaceService: WorkspaceService;
13
+ protected readonly uri: URI;
14
+ protected readonly section: string;
15
+ protected readonly preferenceConfigurations: PreferenceConfigurations;
16
+ private _isSection?;
17
+ private get isSection();
18
+ protected getUri(): URI;
19
+ protected parse(content: string): any;
20
+ protected getPath(preferenceName: string): string[] | undefined;
21
+ }
22
22
  //# sourceMappingURL=section-preference-provider.d.ts.map
@@ -1,97 +1,97 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2019 Ericsson and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
- return c > 3 && r && Object.defineProperty(target, key, r), r;
22
- };
23
- var __metadata = (this && this.__metadata) || function (k, v) {
24
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
- };
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.SectionPreferenceProvider = exports.SectionPreferenceProviderSection = exports.SectionPreferenceProviderUri = void 0;
28
- const inversify_1 = require("@theia/core/shared/inversify");
29
- const uri_1 = require("@theia/core/lib/common/uri");
30
- const abstract_resource_preference_provider_1 = require("./abstract-resource-preference-provider");
31
- const workspace_service_1 = require("@theia/workspace/lib/browser/workspace-service");
32
- const preference_configurations_1 = require("@theia/core/lib/browser/preferences/preference-configurations");
33
- exports.SectionPreferenceProviderUri = Symbol('SectionPreferenceProviderUri');
34
- exports.SectionPreferenceProviderSection = Symbol('SectionPreferenceProviderSection');
35
- /**
36
- * This class encapsulates the logic of using separate files for some workspace configuration like 'launch.json' or 'tasks.json'.
37
- * Anything that is not a contributed section will be in the main config file.
38
- */
39
- let SectionPreferenceProvider = class SectionPreferenceProvider extends abstract_resource_preference_provider_1.AbstractResourcePreferenceProvider {
40
- get isSection() {
41
- if (typeof this._isSection === 'undefined') {
42
- this._isSection = this.preferenceConfigurations.isSectionName(this.section);
43
- }
44
- return this._isSection;
45
- }
46
- getUri() {
47
- return this.uri;
48
- }
49
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
- parse(content) {
51
- const prefs = super.parse(content);
52
- if (this.isSection) {
53
- if (prefs === undefined) {
54
- return undefined;
55
- }
56
- const result = {};
57
- result[this.section] = Object.assign({}, prefs);
58
- return result;
59
- }
60
- else {
61
- return prefs;
62
- }
63
- }
64
- getPath(preferenceName) {
65
- if (!this.isSection) {
66
- return super.getPath(preferenceName);
67
- }
68
- if (preferenceName === this.section) {
69
- return [];
70
- }
71
- if (preferenceName.startsWith(`${this.section}.`)) {
72
- return [preferenceName.slice(this.section.length + 1)];
73
- }
74
- return undefined;
75
- }
76
- };
77
- __decorate([
78
- (0, inversify_1.inject)(workspace_service_1.WorkspaceService),
79
- __metadata("design:type", workspace_service_1.WorkspaceService)
80
- ], SectionPreferenceProvider.prototype, "workspaceService", void 0);
81
- __decorate([
82
- (0, inversify_1.inject)(exports.SectionPreferenceProviderUri),
83
- __metadata("design:type", uri_1.default)
84
- ], SectionPreferenceProvider.prototype, "uri", void 0);
85
- __decorate([
86
- (0, inversify_1.inject)(exports.SectionPreferenceProviderSection),
87
- __metadata("design:type", String)
88
- ], SectionPreferenceProvider.prototype, "section", void 0);
89
- __decorate([
90
- (0, inversify_1.inject)(preference_configurations_1.PreferenceConfigurations),
91
- __metadata("design:type", preference_configurations_1.PreferenceConfigurations)
92
- ], SectionPreferenceProvider.prototype, "preferenceConfigurations", void 0);
93
- SectionPreferenceProvider = __decorate([
94
- (0, inversify_1.injectable)()
95
- ], SectionPreferenceProvider);
96
- exports.SectionPreferenceProvider = SectionPreferenceProvider;
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2019 Ericsson and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.SectionPreferenceProvider = exports.SectionPreferenceProviderSection = exports.SectionPreferenceProviderUri = void 0;
28
+ const inversify_1 = require("@theia/core/shared/inversify");
29
+ const uri_1 = require("@theia/core/lib/common/uri");
30
+ const abstract_resource_preference_provider_1 = require("./abstract-resource-preference-provider");
31
+ const workspace_service_1 = require("@theia/workspace/lib/browser/workspace-service");
32
+ const preference_configurations_1 = require("@theia/core/lib/browser/preferences/preference-configurations");
33
+ exports.SectionPreferenceProviderUri = Symbol('SectionPreferenceProviderUri');
34
+ exports.SectionPreferenceProviderSection = Symbol('SectionPreferenceProviderSection');
35
+ /**
36
+ * This class encapsulates the logic of using separate files for some workspace configuration like 'launch.json' or 'tasks.json'.
37
+ * Anything that is not a contributed section will be in the main config file.
38
+ */
39
+ let SectionPreferenceProvider = class SectionPreferenceProvider extends abstract_resource_preference_provider_1.AbstractResourcePreferenceProvider {
40
+ get isSection() {
41
+ if (typeof this._isSection === 'undefined') {
42
+ this._isSection = this.preferenceConfigurations.isSectionName(this.section);
43
+ }
44
+ return this._isSection;
45
+ }
46
+ getUri() {
47
+ return this.uri;
48
+ }
49
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
+ parse(content) {
51
+ const prefs = super.parse(content);
52
+ if (this.isSection) {
53
+ if (prefs === undefined) {
54
+ return undefined;
55
+ }
56
+ const result = {};
57
+ result[this.section] = Object.assign({}, prefs);
58
+ return result;
59
+ }
60
+ else {
61
+ return prefs;
62
+ }
63
+ }
64
+ getPath(preferenceName) {
65
+ if (!this.isSection) {
66
+ return super.getPath(preferenceName);
67
+ }
68
+ if (preferenceName === this.section) {
69
+ return [];
70
+ }
71
+ if (preferenceName.startsWith(`${this.section}.`)) {
72
+ return [preferenceName.slice(this.section.length + 1)];
73
+ }
74
+ return undefined;
75
+ }
76
+ };
77
+ __decorate([
78
+ (0, inversify_1.inject)(workspace_service_1.WorkspaceService),
79
+ __metadata("design:type", workspace_service_1.WorkspaceService)
80
+ ], SectionPreferenceProvider.prototype, "workspaceService", void 0);
81
+ __decorate([
82
+ (0, inversify_1.inject)(exports.SectionPreferenceProviderUri),
83
+ __metadata("design:type", uri_1.default)
84
+ ], SectionPreferenceProvider.prototype, "uri", void 0);
85
+ __decorate([
86
+ (0, inversify_1.inject)(exports.SectionPreferenceProviderSection),
87
+ __metadata("design:type", String)
88
+ ], SectionPreferenceProvider.prototype, "section", void 0);
89
+ __decorate([
90
+ (0, inversify_1.inject)(preference_configurations_1.PreferenceConfigurations),
91
+ __metadata("design:type", preference_configurations_1.PreferenceConfigurations)
92
+ ], SectionPreferenceProvider.prototype, "preferenceConfigurations", void 0);
93
+ SectionPreferenceProvider = __decorate([
94
+ (0, inversify_1.injectable)()
95
+ ], SectionPreferenceProvider);
96
+ exports.SectionPreferenceProvider = SectionPreferenceProvider;
97
97
  //# sourceMappingURL=section-preference-provider.js.map
@@ -1,22 +1,22 @@
1
- import URI from '@theia/core/lib/common/uri';
2
- import { PreferenceProvider, PreferenceResolveResult } from '@theia/core/lib/browser/preferences/preference-provider';
3
- import { PreferenceConfigurations } from '@theia/core/lib/browser/preferences/preference-configurations';
4
- import { UserPreferenceProvider, UserPreferenceProviderFactory } from './user-preference-provider';
5
- /**
6
- * Binds together preference section prefs providers for user-level preferences.
7
- */
8
- export declare class UserConfigsPreferenceProvider extends PreferenceProvider {
9
- protected readonly providerFactory: UserPreferenceProviderFactory;
10
- protected readonly configurations: PreferenceConfigurations;
11
- protected readonly providers: Map<string, UserPreferenceProvider>;
12
- protected init(): Promise<void>;
13
- protected createProviders(): void;
14
- getConfigUri(resourceUri?: string, sectionName?: string): URI | undefined;
15
- resolve<T>(preferenceName: string, resourceUri?: string): PreferenceResolveResult<T>;
16
- getPreferences(resourceUri?: string): {
17
- [p: string]: any;
18
- };
19
- setPreference(preferenceName: string, value: any, resourceUri?: string): Promise<boolean>;
20
- protected createProvider(uri: URI, sectionName: string): UserPreferenceProvider;
21
- }
1
+ import URI from '@theia/core/lib/common/uri';
2
+ import { PreferenceProvider, PreferenceResolveResult } from '@theia/core/lib/browser/preferences/preference-provider';
3
+ import { PreferenceConfigurations } from '@theia/core/lib/browser/preferences/preference-configurations';
4
+ import { UserPreferenceProvider, UserPreferenceProviderFactory } from './user-preference-provider';
5
+ /**
6
+ * Binds together preference section prefs providers for user-level preferences.
7
+ */
8
+ export declare class UserConfigsPreferenceProvider extends PreferenceProvider {
9
+ protected readonly providerFactory: UserPreferenceProviderFactory;
10
+ protected readonly configurations: PreferenceConfigurations;
11
+ protected readonly providers: Map<string, UserPreferenceProvider>;
12
+ protected init(): Promise<void>;
13
+ protected createProviders(): void;
14
+ getConfigUri(resourceUri?: string, sectionName?: string): URI | undefined;
15
+ resolve<T>(preferenceName: string, resourceUri?: string): PreferenceResolveResult<T>;
16
+ getPreferences(resourceUri?: string): {
17
+ [p: string]: any;
18
+ };
19
+ setPreference(preferenceName: string, value: any, resourceUri?: string): Promise<boolean>;
20
+ protected createProvider(uri: URI, sectionName: string): UserPreferenceProvider;
21
+ }
22
22
  //# sourceMappingURL=user-configs-preference-provider.d.ts.map