@theia/preferences 1.53.0-next.55 → 1.53.0-next.64

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 (54) hide show
  1. package/README.md +81 -81
  2. package/package.json +8 -8
  3. package/src/browser/abstract-resource-preference-provider.spec.ts +95 -95
  4. package/src/browser/abstract-resource-preference-provider.ts +232 -232
  5. package/src/browser/folder-preference-provider.ts +58 -58
  6. package/src/browser/folders-preferences-provider.ts +244 -244
  7. package/src/browser/index.ts +23 -23
  8. package/src/browser/monaco-jsonc-editor.ts +67 -67
  9. package/src/browser/package.spec.ts +28 -28
  10. package/src/browser/preference-bindings.ts +65 -65
  11. package/src/browser/preference-frontend-contribution.ts +38 -38
  12. package/src/browser/preference-frontend-module.ts +66 -66
  13. package/src/browser/preference-open-handler.ts +53 -53
  14. package/src/browser/preference-transaction-manager.ts +287 -287
  15. package/src/browser/preference-tree-model.ts +260 -260
  16. package/src/browser/preferences-contribution.ts +263 -263
  17. package/src/browser/preferences-json-schema-contribution.ts +86 -86
  18. package/src/browser/preferences-monaco-contribution.ts +27 -27
  19. package/src/browser/section-preference-provider.ts +83 -83
  20. package/src/browser/style/index.css +506 -506
  21. package/src/browser/style/preference-array.css +94 -94
  22. package/src/browser/style/preference-context-menu.css +74 -74
  23. package/src/browser/style/preference-file.css +31 -31
  24. package/src/browser/style/preference-object.css +49 -49
  25. package/src/browser/style/search-input.css +66 -66
  26. package/src/browser/user-configs-preference-provider.ts +127 -127
  27. package/src/browser/user-preference-provider.ts +35 -35
  28. package/src/browser/util/preference-layout.ts +381 -381
  29. package/src/browser/util/preference-scope-command-manager.ts +75 -75
  30. package/src/browser/util/preference-tree-generator.ts +260 -260
  31. package/src/browser/util/preference-tree-label-provider.spec.ts +110 -110
  32. package/src/browser/util/preference-tree-label-provider.ts +72 -72
  33. package/src/browser/util/preference-types.ts +177 -177
  34. package/src/browser/views/components/preference-array-input.ts +174 -174
  35. package/src/browser/views/components/preference-boolean-input.ts +69 -69
  36. package/src/browser/views/components/preference-file-input.ts +104 -104
  37. package/src/browser/views/components/preference-json-input.ts +78 -78
  38. package/src/browser/views/components/preference-markdown-renderer.ts +68 -68
  39. package/src/browser/views/components/preference-node-renderer-creator.ts +141 -141
  40. package/src/browser/views/components/preference-node-renderer.ts +477 -477
  41. package/src/browser/views/components/preference-number-input.ts +147 -147
  42. package/src/browser/views/components/preference-select-input.ts +131 -131
  43. package/src/browser/views/components/preference-string-input.ts +76 -76
  44. package/src/browser/views/preference-editor-widget.ts +349 -349
  45. package/src/browser/views/preference-scope-tabbar-widget.tsx +344 -344
  46. package/src/browser/views/preference-searchbar-widget.tsx +183 -183
  47. package/src/browser/views/preference-tree-widget.tsx +102 -102
  48. package/src/browser/views/preference-widget-bindings.ts +102 -102
  49. package/src/browser/views/preference-widget.tsx +118 -118
  50. package/src/browser/workspace-file-preference-provider.ts +100 -100
  51. package/src/browser/workspace-preference-provider.ts +134 -134
  52. package/src/common/cli-preferences.ts +22 -22
  53. package/src/node/preference-backend-module.ts +33 -33
  54. package/src/node/preference-cli-contribution.ts +48 -48
@@ -1,244 +1,244 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2019 Ericsson and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- /* eslint-disable @typescript-eslint/no-explicit-any */
18
-
19
- import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
20
- import URI from '@theia/core/lib/common/uri';
21
- import { PreferenceProvider, PreferenceResolveResult, PreferenceScope } from '@theia/core/lib/browser/preferences';
22
- import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
23
- import { PreferenceConfigurations } from '@theia/core/lib/browser/preferences/preference-configurations';
24
- import { FolderPreferenceProvider, FolderPreferenceProviderFactory } from './folder-preference-provider';
25
- import { FileStat } from '@theia/filesystem/lib/common/files';
26
-
27
- @injectable()
28
- export class FoldersPreferencesProvider extends PreferenceProvider {
29
-
30
- @inject(WorkspaceService)
31
- protected readonly workspaceService: WorkspaceService;
32
-
33
- @inject(FolderPreferenceProviderFactory)
34
- protected readonly folderPreferenceProviderFactory: FolderPreferenceProviderFactory;
35
-
36
- @inject(PreferenceConfigurations)
37
- protected readonly configurations: PreferenceConfigurations;
38
-
39
- protected readonly providers = new Map<string, FolderPreferenceProvider>();
40
-
41
- @postConstruct()
42
- protected init(): void {
43
- this.doInit();
44
- }
45
-
46
- protected async doInit(): Promise<void> {
47
- await this.workspaceService.roots;
48
-
49
- this.updateProviders();
50
- this.workspaceService.onWorkspaceChanged(() => this.updateProviders());
51
-
52
- const readyPromises: Promise<void>[] = [];
53
- for (const provider of this.providers.values()) {
54
- readyPromises.push(provider.ready.catch(e => console.error(e)));
55
- }
56
- Promise.all(readyPromises).then(() => this._ready.resolve());
57
- }
58
-
59
- protected updateProviders(): void {
60
- const roots = this.workspaceService.tryGetRoots();
61
- const toDelete = new Set(this.providers.keys());
62
- for (const folder of roots) {
63
- for (const configPath of this.configurations.getPaths()) {
64
- for (const configName of [...this.configurations.getSectionNames(), this.configurations.getConfigName()]) {
65
- const sectionUri = this.configurations.createUri(folder.resource, configPath, configName);
66
- const sectionKey = sectionUri.toString();
67
- toDelete.delete(sectionKey);
68
- if (!this.providers.has(sectionKey)) {
69
- const provider = this.createProvider(sectionUri, configName, folder);
70
- this.providers.set(sectionKey, provider);
71
- }
72
- }
73
- }
74
- }
75
- for (const key of toDelete) {
76
- const provider = this.providers.get(key);
77
- if (provider) {
78
- this.providers.delete(key);
79
- provider.dispose();
80
- }
81
- }
82
- }
83
-
84
- override getConfigUri(resourceUri?: string, sectionName: string = this.configurations.getConfigName()): URI | undefined {
85
- for (const provider of this.getFolderProviders(resourceUri)) {
86
- const configUri = provider.getConfigUri(resourceUri);
87
- if (configUri && this.configurations.getName(configUri) === sectionName) {
88
- return configUri;
89
- }
90
- }
91
- return undefined;
92
- }
93
-
94
- override getContainingConfigUri(resourceUri?: string, sectionName: string = this.configurations.getConfigName()): URI | undefined {
95
- for (const provider of this.getFolderProviders(resourceUri)) {
96
- const configUri = provider.getConfigUri();
97
- if (provider.contains(resourceUri) && this.configurations.getName(configUri) === sectionName) {
98
- return configUri;
99
- }
100
- }
101
- return undefined;
102
- }
103
-
104
- override getDomain(): string[] {
105
- return this.workspaceService.tryGetRoots().map(root => root.resource.toString());
106
- }
107
-
108
- override resolve<T>(preferenceName: string, resourceUri?: string): PreferenceResolveResult<T> {
109
- const result: PreferenceResolveResult<T> = {};
110
- const groups = this.groupProvidersByConfigName(resourceUri);
111
- for (const group of groups.values()) {
112
- for (const provider of group) {
113
- const { value, configUri } = provider.resolve<T>(preferenceName, resourceUri);
114
- if (configUri && value !== undefined) {
115
- result.configUri = configUri;
116
- result.value = PreferenceProvider.merge(result.value as any, value as any) as any;
117
- break;
118
- }
119
- }
120
- }
121
- return result;
122
- }
123
-
124
- getPreferences(resourceUri?: string): { [p: string]: any } {
125
- let result = {};
126
- const groups = this.groupProvidersByConfigName(resourceUri);
127
- for (const group of groups.values()) {
128
- for (const provider of group) {
129
- if (provider.getConfigUri(resourceUri)) {
130
- const preferences = provider.getPreferences();
131
- result = PreferenceProvider.merge(result, preferences) as any;
132
- break;
133
- }
134
- }
135
- }
136
- return result;
137
- }
138
-
139
- async setPreference(preferenceName: string, value: any, resourceUri?: string): Promise<boolean> {
140
- const firstPathFragment = preferenceName.split('.', 1)[0];
141
- const defaultConfigName = this.configurations.getConfigName();
142
- const configName = this.configurations.isSectionName(firstPathFragment) ? firstPathFragment : defaultConfigName;
143
-
144
- const providers = this.getFolderProviders(resourceUri);
145
- let configPath: string | undefined;
146
- const candidates = providers.filter(provider => {
147
- // Attempt to figure out the settings folder (.vscode or .theia) we're interested in.
148
- const containingConfigUri = provider.getConfigUri(resourceUri);
149
- if (configPath === undefined && containingConfigUri) {
150
- configPath = this.configurations.getPath(containingConfigUri);
151
- }
152
- const providerName = this.configurations.getName(containingConfigUri ?? provider.getConfigUri());
153
- return providerName === configName || providerName === defaultConfigName;
154
- });
155
-
156
- const configNameAndPathMatches = [];
157
- const configNameOnlyMatches = [];
158
- const configUriMatches = [];
159
- const otherMatches = [];
160
-
161
- for (const candidate of candidates) {
162
- const domainMatches = candidate.getConfigUri(resourceUri);
163
- const configUri = domainMatches ?? candidate.getConfigUri();
164
- const nameMatches = this.configurations.getName(configUri) === configName;
165
- const pathMatches = this.configurations.getPath(configUri) === configPath;
166
-
167
- // Perfect match, run immediately in case we can bail out early.
168
- if (nameMatches && domainMatches) {
169
- if (await candidate.setPreference(preferenceName, value, resourceUri)) {
170
- return true;
171
- }
172
- } else if (nameMatches && pathMatches) { // Right file in the right folder.
173
- configNameAndPathMatches.push(candidate);
174
- } else if (nameMatches) { // Right file.
175
- configNameOnlyMatches.push(candidate);
176
- } else if (domainMatches) { // Currently valid and governs target URI
177
- configUriMatches.push(candidate);
178
- } else {
179
- otherMatches.push(candidate);
180
- }
181
- }
182
-
183
- const candidateSets = [configNameAndPathMatches, configNameOnlyMatches, configUriMatches, otherMatches];
184
-
185
- for (const candidateSet of candidateSets) {
186
- for (const candidate of candidateSet) {
187
- if (await candidate.setPreference(preferenceName, value, resourceUri)) {
188
- return true;
189
- }
190
- }
191
- }
192
-
193
- return false;
194
- }
195
-
196
- override canHandleScope(scope: PreferenceScope): boolean {
197
- return this.workspaceService.isMultiRootWorkspaceOpened && scope === PreferenceScope.Folder || scope === PreferenceScope.Workspace;
198
- }
199
-
200
- protected groupProvidersByConfigName(resourceUri?: string): Map<string, FolderPreferenceProvider[]> {
201
- const groups = new Map<string, FolderPreferenceProvider[]>();
202
- const providers = this.getFolderProviders(resourceUri);
203
- for (const configName of [this.configurations.getConfigName(), ...this.configurations.getSectionNames()]) {
204
- const group = [];
205
- for (const provider of providers) {
206
- if (this.configurations.getName(provider.getConfigUri()) === configName) {
207
- group.push(provider);
208
- }
209
- }
210
- groups.set(configName, group);
211
- }
212
- return groups;
213
- }
214
-
215
- protected getFolderProviders(resourceUri?: string): FolderPreferenceProvider[] {
216
- if (!resourceUri) {
217
- return [];
218
- }
219
- const resourcePath = new URI(resourceUri).path;
220
- let folder: Readonly<{ relativity: number, uri?: string }> = { relativity: Number.MAX_SAFE_INTEGER };
221
- const providers = new Map<string, FolderPreferenceProvider[]>();
222
- for (const provider of this.providers.values()) {
223
- const uri = provider.folderUri.toString();
224
- const folderProviders = (providers.get(uri) || []);
225
- folderProviders.push(provider);
226
- providers.set(uri, folderProviders);
227
-
228
- // in case we have nested folders mounted as workspace roots, select the innermost enclosing folder
229
- const relativity = provider.folderUri.path.relativity(resourcePath);
230
- if (relativity >= 0 && folder.relativity > relativity) {
231
- folder = { relativity, uri };
232
- }
233
- }
234
- return folder.uri && providers.get(folder.uri) || [];
235
- }
236
-
237
- protected createProvider(uri: URI, section: string, folder: FileStat): FolderPreferenceProvider {
238
- const provider = this.folderPreferenceProviderFactory(uri, section, folder);
239
- this.toDispose.push(provider);
240
- this.toDispose.push(provider.onDidPreferencesChanged(change => this.onDidPreferencesChangedEmitter.fire(change)));
241
- return provider;
242
- }
243
-
244
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2019 Ericsson and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ /* eslint-disable @typescript-eslint/no-explicit-any */
18
+
19
+ import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
20
+ import URI from '@theia/core/lib/common/uri';
21
+ import { PreferenceProvider, PreferenceResolveResult, PreferenceScope } from '@theia/core/lib/browser/preferences';
22
+ import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
23
+ import { PreferenceConfigurations } from '@theia/core/lib/browser/preferences/preference-configurations';
24
+ import { FolderPreferenceProvider, FolderPreferenceProviderFactory } from './folder-preference-provider';
25
+ import { FileStat } from '@theia/filesystem/lib/common/files';
26
+
27
+ @injectable()
28
+ export class FoldersPreferencesProvider extends PreferenceProvider {
29
+
30
+ @inject(WorkspaceService)
31
+ protected readonly workspaceService: WorkspaceService;
32
+
33
+ @inject(FolderPreferenceProviderFactory)
34
+ protected readonly folderPreferenceProviderFactory: FolderPreferenceProviderFactory;
35
+
36
+ @inject(PreferenceConfigurations)
37
+ protected readonly configurations: PreferenceConfigurations;
38
+
39
+ protected readonly providers = new Map<string, FolderPreferenceProvider>();
40
+
41
+ @postConstruct()
42
+ protected init(): void {
43
+ this.doInit();
44
+ }
45
+
46
+ protected async doInit(): Promise<void> {
47
+ await this.workspaceService.roots;
48
+
49
+ this.updateProviders();
50
+ this.workspaceService.onWorkspaceChanged(() => this.updateProviders());
51
+
52
+ const readyPromises: Promise<void>[] = [];
53
+ for (const provider of this.providers.values()) {
54
+ readyPromises.push(provider.ready.catch(e => console.error(e)));
55
+ }
56
+ Promise.all(readyPromises).then(() => this._ready.resolve());
57
+ }
58
+
59
+ protected updateProviders(): void {
60
+ const roots = this.workspaceService.tryGetRoots();
61
+ const toDelete = new Set(this.providers.keys());
62
+ for (const folder of roots) {
63
+ for (const configPath of this.configurations.getPaths()) {
64
+ for (const configName of [...this.configurations.getSectionNames(), this.configurations.getConfigName()]) {
65
+ const sectionUri = this.configurations.createUri(folder.resource, configPath, configName);
66
+ const sectionKey = sectionUri.toString();
67
+ toDelete.delete(sectionKey);
68
+ if (!this.providers.has(sectionKey)) {
69
+ const provider = this.createProvider(sectionUri, configName, folder);
70
+ this.providers.set(sectionKey, provider);
71
+ }
72
+ }
73
+ }
74
+ }
75
+ for (const key of toDelete) {
76
+ const provider = this.providers.get(key);
77
+ if (provider) {
78
+ this.providers.delete(key);
79
+ provider.dispose();
80
+ }
81
+ }
82
+ }
83
+
84
+ override getConfigUri(resourceUri?: string, sectionName: string = this.configurations.getConfigName()): URI | undefined {
85
+ for (const provider of this.getFolderProviders(resourceUri)) {
86
+ const configUri = provider.getConfigUri(resourceUri);
87
+ if (configUri && this.configurations.getName(configUri) === sectionName) {
88
+ return configUri;
89
+ }
90
+ }
91
+ return undefined;
92
+ }
93
+
94
+ override getContainingConfigUri(resourceUri?: string, sectionName: string = this.configurations.getConfigName()): URI | undefined {
95
+ for (const provider of this.getFolderProviders(resourceUri)) {
96
+ const configUri = provider.getConfigUri();
97
+ if (provider.contains(resourceUri) && this.configurations.getName(configUri) === sectionName) {
98
+ return configUri;
99
+ }
100
+ }
101
+ return undefined;
102
+ }
103
+
104
+ override getDomain(): string[] {
105
+ return this.workspaceService.tryGetRoots().map(root => root.resource.toString());
106
+ }
107
+
108
+ override resolve<T>(preferenceName: string, resourceUri?: string): PreferenceResolveResult<T> {
109
+ const result: PreferenceResolveResult<T> = {};
110
+ const groups = this.groupProvidersByConfigName(resourceUri);
111
+ for (const group of groups.values()) {
112
+ for (const provider of group) {
113
+ const { value, configUri } = provider.resolve<T>(preferenceName, resourceUri);
114
+ if (configUri && value !== undefined) {
115
+ result.configUri = configUri;
116
+ result.value = PreferenceProvider.merge(result.value as any, value as any) as any;
117
+ break;
118
+ }
119
+ }
120
+ }
121
+ return result;
122
+ }
123
+
124
+ getPreferences(resourceUri?: string): { [p: string]: any } {
125
+ let result = {};
126
+ const groups = this.groupProvidersByConfigName(resourceUri);
127
+ for (const group of groups.values()) {
128
+ for (const provider of group) {
129
+ if (provider.getConfigUri(resourceUri)) {
130
+ const preferences = provider.getPreferences();
131
+ result = PreferenceProvider.merge(result, preferences) as any;
132
+ break;
133
+ }
134
+ }
135
+ }
136
+ return result;
137
+ }
138
+
139
+ async setPreference(preferenceName: string, value: any, resourceUri?: string): Promise<boolean> {
140
+ const firstPathFragment = preferenceName.split('.', 1)[0];
141
+ const defaultConfigName = this.configurations.getConfigName();
142
+ const configName = this.configurations.isSectionName(firstPathFragment) ? firstPathFragment : defaultConfigName;
143
+
144
+ const providers = this.getFolderProviders(resourceUri);
145
+ let configPath: string | undefined;
146
+ const candidates = providers.filter(provider => {
147
+ // Attempt to figure out the settings folder (.vscode or .theia) we're interested in.
148
+ const containingConfigUri = provider.getConfigUri(resourceUri);
149
+ if (configPath === undefined && containingConfigUri) {
150
+ configPath = this.configurations.getPath(containingConfigUri);
151
+ }
152
+ const providerName = this.configurations.getName(containingConfigUri ?? provider.getConfigUri());
153
+ return providerName === configName || providerName === defaultConfigName;
154
+ });
155
+
156
+ const configNameAndPathMatches = [];
157
+ const configNameOnlyMatches = [];
158
+ const configUriMatches = [];
159
+ const otherMatches = [];
160
+
161
+ for (const candidate of candidates) {
162
+ const domainMatches = candidate.getConfigUri(resourceUri);
163
+ const configUri = domainMatches ?? candidate.getConfigUri();
164
+ const nameMatches = this.configurations.getName(configUri) === configName;
165
+ const pathMatches = this.configurations.getPath(configUri) === configPath;
166
+
167
+ // Perfect match, run immediately in case we can bail out early.
168
+ if (nameMatches && domainMatches) {
169
+ if (await candidate.setPreference(preferenceName, value, resourceUri)) {
170
+ return true;
171
+ }
172
+ } else if (nameMatches && pathMatches) { // Right file in the right folder.
173
+ configNameAndPathMatches.push(candidate);
174
+ } else if (nameMatches) { // Right file.
175
+ configNameOnlyMatches.push(candidate);
176
+ } else if (domainMatches) { // Currently valid and governs target URI
177
+ configUriMatches.push(candidate);
178
+ } else {
179
+ otherMatches.push(candidate);
180
+ }
181
+ }
182
+
183
+ const candidateSets = [configNameAndPathMatches, configNameOnlyMatches, configUriMatches, otherMatches];
184
+
185
+ for (const candidateSet of candidateSets) {
186
+ for (const candidate of candidateSet) {
187
+ if (await candidate.setPreference(preferenceName, value, resourceUri)) {
188
+ return true;
189
+ }
190
+ }
191
+ }
192
+
193
+ return false;
194
+ }
195
+
196
+ override canHandleScope(scope: PreferenceScope): boolean {
197
+ return this.workspaceService.isMultiRootWorkspaceOpened && scope === PreferenceScope.Folder || scope === PreferenceScope.Workspace;
198
+ }
199
+
200
+ protected groupProvidersByConfigName(resourceUri?: string): Map<string, FolderPreferenceProvider[]> {
201
+ const groups = new Map<string, FolderPreferenceProvider[]>();
202
+ const providers = this.getFolderProviders(resourceUri);
203
+ for (const configName of [this.configurations.getConfigName(), ...this.configurations.getSectionNames()]) {
204
+ const group = [];
205
+ for (const provider of providers) {
206
+ if (this.configurations.getName(provider.getConfigUri()) === configName) {
207
+ group.push(provider);
208
+ }
209
+ }
210
+ groups.set(configName, group);
211
+ }
212
+ return groups;
213
+ }
214
+
215
+ protected getFolderProviders(resourceUri?: string): FolderPreferenceProvider[] {
216
+ if (!resourceUri) {
217
+ return [];
218
+ }
219
+ const resourcePath = new URI(resourceUri).path;
220
+ let folder: Readonly<{ relativity: number, uri?: string }> = { relativity: Number.MAX_SAFE_INTEGER };
221
+ const providers = new Map<string, FolderPreferenceProvider[]>();
222
+ for (const provider of this.providers.values()) {
223
+ const uri = provider.folderUri.toString();
224
+ const folderProviders = (providers.get(uri) || []);
225
+ folderProviders.push(provider);
226
+ providers.set(uri, folderProviders);
227
+
228
+ // in case we have nested folders mounted as workspace roots, select the innermost enclosing folder
229
+ const relativity = provider.folderUri.path.relativity(resourcePath);
230
+ if (relativity >= 0 && folder.relativity > relativity) {
231
+ folder = { relativity, uri };
232
+ }
233
+ }
234
+ return folder.uri && providers.get(folder.uri) || [];
235
+ }
236
+
237
+ protected createProvider(uri: URI, section: string, folder: FileStat): FolderPreferenceProvider {
238
+ const provider = this.folderPreferenceProviderFactory(uri, section, folder);
239
+ this.toDispose.push(provider);
240
+ this.toDispose.push(provider.onDidPreferencesChanged(change => this.onDidPreferencesChangedEmitter.fire(change)));
241
+ return provider;
242
+ }
243
+
244
+ }
@@ -1,23 +1,23 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2018 Ericsson and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- export * from '@theia/core/lib/browser/preferences';
18
- export * from './abstract-resource-preference-provider';
19
- export * from './user-preference-provider';
20
- export * from './workspace-preference-provider';
21
- export * from './folders-preferences-provider';
22
- export * from './folder-preference-provider';
23
- export * from './user-configs-preference-provider';
1
+ // *****************************************************************************
2
+ // Copyright (C) 2018 Ericsson and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ export * from '@theia/core/lib/browser/preferences';
18
+ export * from './abstract-resource-preference-provider';
19
+ export * from './user-preference-provider';
20
+ export * from './workspace-preference-provider';
21
+ export * from './folders-preferences-provider';
22
+ export * from './folder-preference-provider';
23
+ export * from './user-configs-preference-provider';