@theia/plugin-ext 1.29.0-next.2 → 1.29.0-next.23

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 (112) hide show
  1. package/lib/common/plugin-api-rpc-model.d.ts +7 -0
  2. package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
  3. package/lib/common/plugin-api-rpc-model.js.map +1 -1
  4. package/lib/common/plugin-api-rpc.d.ts +15 -9
  5. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  6. package/lib/common/plugin-api-rpc.js.map +1 -1
  7. package/lib/common/rpc-protocol.d.ts +1 -1
  8. package/lib/common/rpc-protocol.d.ts.map +1 -1
  9. package/lib/common/rpc-protocol.js +3 -3
  10. package/lib/common/rpc-protocol.js.map +1 -1
  11. package/lib/main/browser/comments/comment-thread-widget.d.ts +2 -0
  12. package/lib/main/browser/comments/comment-thread-widget.d.ts.map +1 -1
  13. package/lib/main/browser/comments/comment-thread-widget.js +4 -3
  14. package/lib/main/browser/comments/comment-thread-widget.js.map +1 -1
  15. package/lib/main/browser/debug/debug-main.d.ts.map +1 -1
  16. package/lib/main/browser/debug/debug-main.js +20 -10
  17. package/lib/main/browser/debug/debug-main.js.map +1 -1
  18. package/lib/main/browser/debug/plugin-debug-session-factory.d.ts +4 -4
  19. package/lib/main/browser/debug/plugin-debug-session-factory.d.ts.map +1 -1
  20. package/lib/main/browser/debug/plugin-debug-session-factory.js.map +1 -1
  21. package/lib/main/browser/languages-main.d.ts +6 -1
  22. package/lib/main/browser/languages-main.d.ts.map +1 -1
  23. package/lib/main/browser/languages-main.js +15 -1
  24. package/lib/main/browser/languages-main.js.map +1 -1
  25. package/lib/main/browser/plugin-ext-frontend-module.d.ts +1 -0
  26. package/lib/main/browser/plugin-ext-frontend-module.d.ts.map +1 -1
  27. package/lib/main/browser/plugin-ext-frontend-module.js +1 -0
  28. package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
  29. package/lib/main/browser/preference-registry-main.d.ts +4 -3
  30. package/lib/main/browser/preference-registry-main.d.ts.map +1 -1
  31. package/lib/main/browser/preference-registry-main.js +26 -14
  32. package/lib/main/browser/preference-registry-main.js.map +1 -1
  33. package/lib/main/browser/theme-icon-override.d.ts +2 -0
  34. package/lib/main/browser/theme-icon-override.d.ts.map +1 -0
  35. package/lib/main/browser/theme-icon-override.js +217 -0
  36. package/lib/main/browser/theme-icon-override.js.map +1 -0
  37. package/lib/main/browser/view/tree-view-decorator-service.d.ts +1 -1
  38. package/lib/main/browser/view/tree-view-decorator-service.d.ts.map +1 -1
  39. package/lib/main/browser/view/tree-view-decorator-service.js +1 -1
  40. package/lib/main/browser/view/tree-view-decorator-service.js.map +1 -1
  41. package/lib/plugin/languages/code-action.d.ts.map +1 -1
  42. package/lib/plugin/languages/code-action.js +8 -9
  43. package/lib/plugin/languages/code-action.js.map +1 -1
  44. package/lib/plugin/languages/document-highlight.d.ts.map +1 -1
  45. package/lib/plugin/languages/document-highlight.js +0 -1
  46. package/lib/plugin/languages/document-highlight.js.map +1 -1
  47. package/lib/plugin/languages/evaluatable-expression.d.ts +12 -0
  48. package/lib/plugin/languages/evaluatable-expression.d.ts.map +1 -0
  49. package/lib/plugin/languages/evaluatable-expression.js +41 -0
  50. package/lib/plugin/languages/evaluatable-expression.js.map +1 -0
  51. package/lib/plugin/languages/util.d.ts +2 -2
  52. package/lib/plugin/languages/util.d.ts.map +1 -1
  53. package/lib/plugin/languages/util.js +0 -2
  54. package/lib/plugin/languages/util.js.map +1 -1
  55. package/lib/plugin/languages.d.ts +3 -1
  56. package/lib/plugin/languages.d.ts.map +1 -1
  57. package/lib/plugin/languages.js +11 -0
  58. package/lib/plugin/languages.js.map +1 -1
  59. package/lib/plugin/plugin-context.d.ts.map +1 -1
  60. package/lib/plugin/plugin-context.js +4 -0
  61. package/lib/plugin/plugin-context.js.map +1 -1
  62. package/lib/plugin/plugin-storage.d.ts +1 -0
  63. package/lib/plugin/plugin-storage.d.ts.map +1 -1
  64. package/lib/plugin/plugin-storage.js +3 -0
  65. package/lib/plugin/plugin-storage.js.map +1 -1
  66. package/lib/plugin/preference-registry.d.ts +15 -2
  67. package/lib/plugin/preference-registry.d.ts.map +1 -1
  68. package/lib/plugin/preference-registry.js +105 -62
  69. package/lib/plugin/preference-registry.js.map +1 -1
  70. package/lib/plugin/preference-registry.spec.js +207 -35
  71. package/lib/plugin/preference-registry.spec.js.map +1 -1
  72. package/lib/plugin/type-converters.d.ts +7 -6
  73. package/lib/plugin/type-converters.d.ts.map +1 -1
  74. package/lib/plugin/type-converters.js +54 -55
  75. package/lib/plugin/type-converters.js.map +1 -1
  76. package/lib/plugin/types-impl.d.ts +8 -3
  77. package/lib/plugin/types-impl.d.ts.map +1 -1
  78. package/lib/plugin/types-impl.js +22 -10
  79. package/lib/plugin/types-impl.js.map +1 -1
  80. package/package.json +24 -24
  81. package/src/common/plugin-api-rpc-model.ts +10 -0
  82. package/src/common/plugin-api-rpc.ts +18 -9
  83. package/src/common/rpc-protocol.ts +5 -5
  84. package/src/main/browser/comments/comment-thread-widget.tsx +5 -3
  85. package/src/main/browser/debug/debug-main.ts +19 -11
  86. package/src/main/browser/debug/plugin-debug-session-factory.ts +3 -3
  87. package/src/main/browser/languages-main.ts +23 -1
  88. package/src/main/browser/plugin-ext-frontend-module.ts +1 -0
  89. package/src/main/browser/preference-registry-main.ts +23 -14
  90. package/src/main/browser/theme-icon-override.ts +221 -0
  91. package/src/main/browser/view/tree-view-decorator-service.ts +2 -2
  92. package/src/plugin/languages/code-action.ts +9 -12
  93. package/src/plugin/languages/document-highlight.ts +1 -2
  94. package/src/plugin/languages/evaluatable-expression.ts +47 -0
  95. package/src/plugin/languages/util.ts +2 -4
  96. package/src/plugin/languages.ts +15 -0
  97. package/src/plugin/plugin-context.ts +6 -1
  98. package/src/plugin/plugin-storage.ts +4 -0
  99. package/src/plugin/preference-registry.spec.ts +247 -39
  100. package/src/plugin/preference-registry.ts +107 -71
  101. package/src/plugin/type-converters.ts +58 -59
  102. package/src/plugin/types-impl.ts +30 -14
  103. package/lib/plugin/preferences/configuration.d.ts +0 -35
  104. package/lib/plugin/preferences/configuration.d.ts.map +0 -1
  105. package/lib/plugin/preferences/configuration.js +0 -137
  106. package/lib/plugin/preferences/configuration.js.map +0 -1
  107. package/lib/plugin/preferences/configuration.spec.d.ts +0 -2
  108. package/lib/plugin/preferences/configuration.spec.d.ts.map +0 -1
  109. package/lib/plugin/preferences/configuration.spec.js +0 -178
  110. package/lib/plugin/preferences/configuration.spec.js.map +0 -1
  111. package/src/plugin/preferences/configuration.spec.ts +0 -292
  112. package/src/plugin/preferences/configuration.ts +0 -167
@@ -1 +0,0 @@
1
- {"version":3,"file":"configuration.spec.js","sourceRoot":"","sources":["../../../src/plugin/preferences/configuration.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;AAEhF,uDAAuD;AACvD,6BAA6B;AAC7B,mDAAoE;AAEpE,0FAAsF;AAEtF,8DAAoD;AAEpD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAS3B,IAAI,OAAwB,CAAC;AAE7B,MAAM,QAAQ,GAAG,CAAC,8BAA8B,EAAE,8BAA8B,CAAC,CAAC;AAElF,MAAM,YAAY,GAAG,SAAS,CAAC;AAC/B,MAAM,WAAW,GAAmB;IAChC,CAAC,kCAAe,CAAC,OAAO,CAAC,EAAE;QACvB,CAAC,YAAY,CAAC,EAAE,CAAC;KACpB;IACD,CAAC,kCAAe,CAAC,IAAI,CAAC,EAAE;QACpB,CAAC,YAAY,CAAC,EAAE,CAAC;KACpB;IACD,CAAC,kCAAe,CAAC,SAAS,CAAC,EAAE;QACzB,CAAC,YAAY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BAAkB,GAAG,IAAI,kCAAkB,EAAE,CAAC;YACpD,kBAAkB,CAAC,KAAK,CAAC,IAAI,kCAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;YAC1D,MAAM,eAAe,GAAG,MAAM,CAAC,SAAgB,CAAC;YAChD,MAAM,CAAC,eAAe,CAAC,yCAAyC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;YACxF,MAAM,SAAS,GAAG,EAAS,CAAC;YAC5B,MAAM,CAAC,SAAS,CAAC,yCAAyC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;QACtF,CAAC,CAAC,CAAC;IAEP,CAAC,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"}
@@ -1,292 +0,0 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2019 Red Hat, Inc. 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 WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- /* eslint-disable @typescript-eslint/no-explicit-any */
18
- import * as chai from 'chai';
19
- import { Configuration, ConfigurationModel } from './configuration';
20
- import { PreferenceData } from '../../common';
21
- import { PreferenceScope } from '@theia/core/lib/common/preferences/preference-scope';
22
- import { WorkspaceExtImpl } from '../workspace';
23
- import { URI } from '@theia/core/shared/vscode-uri';
24
-
25
- const expect = chai.expect;
26
-
27
- interface Inspect<C> {
28
- default: C;
29
- user: C;
30
- workspace?: C;
31
- workspaceFolder?: C;
32
- value: C;
33
- }
34
- let inspect: Inspect<number>;
35
-
36
- const projects = ['/projects/workspace/project1', '/projects/workspace/project2'];
37
-
38
- const propertyName = 'tabSize';
39
- const preferences: PreferenceData = {
40
- [PreferenceScope.Default]: {
41
- [propertyName]: 6,
42
- },
43
- [PreferenceScope.User]: {
44
- [propertyName]: 5
45
- },
46
- [PreferenceScope.Workspace]: {
47
- [propertyName]: 4
48
- },
49
- [PreferenceScope.Folder]: {
50
- [projects[0]]: {
51
- [propertyName]: 3
52
- },
53
- [projects[1]]: {
54
- [propertyName]: 2
55
- }
56
- }
57
- };
58
-
59
- const workspace: WorkspaceExtImpl = {} as WorkspaceExtImpl;
60
- let configuration: Configuration;
61
- let defaultConfiguration: ConfigurationModel;
62
- let userConfiguration: ConfigurationModel;
63
- let workspaceConfiguration: ConfigurationModel;
64
- let folderConfigurations: { [key: string]: ConfigurationModel };
65
- before(() => {
66
- workspace.getWorkspaceFolder = (uri => {
67
- const name = uri.toString().replace(/[^\/]+$/, '$1');
68
- const index = projects.indexOf(uri.toString());
69
- return { uri, name, index };
70
- });
71
-
72
- defaultConfiguration = new ConfigurationModel(
73
- preferences[PreferenceScope.Default],
74
- Object.keys(preferences[PreferenceScope.Default])
75
- );
76
- userConfiguration = new ConfigurationModel(
77
- preferences[PreferenceScope.User],
78
- Object.keys(preferences[PreferenceScope.User])
79
- );
80
- workspaceConfiguration = new ConfigurationModel(
81
- preferences[PreferenceScope.Workspace],
82
- Object.keys(preferences[PreferenceScope.Workspace])
83
- );
84
- folderConfigurations = projects.reduce((configurations: { [key: string]: ConfigurationModel }, project: string) => {
85
- const folderPrefs = preferences[PreferenceScope.Folder][project];
86
- configurations[project] = new ConfigurationModel(folderPrefs, Object.keys(folderPrefs));
87
- return configurations;
88
- }, {});
89
- });
90
-
91
- describe('Configuration:', () => {
92
-
93
- describe('Default scope preferences:', () => {
94
-
95
- beforeEach(() => {
96
- configuration = new Configuration(
97
- defaultConfiguration, new ConfigurationModel({}, []), undefined, undefined
98
- );
99
- inspect = configuration.inspect(propertyName, workspace, undefined);
100
- });
101
-
102
- it('should have correct value of \'default\' property', () => {
103
- expect(inspect).to.have.property(
104
- 'default',
105
- preferences[PreferenceScope.Default][propertyName]
106
- );
107
- expect(inspect.default).to.equal(preferences[PreferenceScope.Default][propertyName]);
108
- });
109
-
110
- it('should have correct value of \'value\' property', () => {
111
- expect(inspect).to.have.property(
112
- 'value',
113
- preferences[PreferenceScope.Default][propertyName]
114
- );
115
- expect(inspect.value).to.equal(preferences[PreferenceScope.Default][propertyName]);
116
- });
117
-
118
- });
119
-
120
- describe('User scope preferences:', () => {
121
-
122
- beforeEach(() => {
123
- configuration = new Configuration(
124
- defaultConfiguration, userConfiguration, undefined, undefined
125
- );
126
- inspect = configuration.inspect(propertyName, workspace, undefined);
127
- });
128
-
129
- it('should have correct value of \'default\' property', () => {
130
- expect(inspect).to.have.property(
131
- 'default',
132
- preferences[PreferenceScope.Default][propertyName]
133
- );
134
- expect(inspect.default).to.equal(preferences[PreferenceScope.Default][propertyName]);
135
- });
136
-
137
- it('should have correct value of \'user\' property', () => {
138
- expect(inspect).to.have.property(
139
- 'user',
140
- preferences[PreferenceScope.User][propertyName]
141
- );
142
- expect(inspect.user).to.equal(preferences[PreferenceScope.User][propertyName]);
143
- });
144
-
145
- it('should have correct value of \'value\' property', () => {
146
- expect(inspect).to.have.property(
147
- 'value',
148
- preferences[PreferenceScope.User][propertyName]
149
- );
150
- expect(inspect.value).to.equal(preferences[PreferenceScope.User][propertyName]);
151
- });
152
-
153
- });
154
-
155
- describe('Workspace scope preferences:', () => {
156
-
157
- beforeEach(() => {
158
- configuration = new Configuration(
159
- defaultConfiguration, userConfiguration, workspaceConfiguration, undefined
160
- );
161
- inspect = configuration.inspect(propertyName, workspace, undefined);
162
- });
163
-
164
- it('should have correct value of \'default\' property', () => {
165
- expect(inspect).to.have.property(
166
- 'default',
167
- preferences[PreferenceScope.Default][propertyName]
168
- );
169
- expect(inspect.default).to.equal(preferences[PreferenceScope.Default][propertyName]);
170
- });
171
-
172
- it('should have correct value of \'user\' property', () => {
173
- expect(inspect).to.have.property(
174
- 'user',
175
- preferences[PreferenceScope.User][propertyName]
176
- );
177
- expect(inspect.user).to.equal(preferences[PreferenceScope.User][propertyName]);
178
- });
179
-
180
- it('should have correct value of \'workspace\' property', () => {
181
- expect(inspect).to.have.property(
182
- 'workspace',
183
- preferences[PreferenceScope.Workspace][propertyName]
184
- );
185
- expect(inspect.workspace).to.equal(preferences[PreferenceScope.Workspace][propertyName]);
186
- });
187
-
188
- it('should have correct value of \'value\' property', () => {
189
- expect(inspect).to.have.property(
190
- 'value',
191
- preferences[PreferenceScope.Workspace][propertyName]
192
- );
193
- expect(inspect.value).to.equal(preferences[PreferenceScope.Workspace][propertyName]);
194
- });
195
-
196
- });
197
-
198
- describe('Folder scope preferences:', () => {
199
- const project = projects[0];
200
-
201
- beforeEach(() => {
202
- configuration = new Configuration(
203
- defaultConfiguration, userConfiguration, workspaceConfiguration, folderConfigurations
204
- );
205
- const resource = URI.revive({ path: project, scheme: '', authority: '', query: '', fragment: '' });
206
- inspect = configuration.inspect(propertyName, workspace, resource);
207
- });
208
-
209
- it('should have correct value of \'default\' property', () => {
210
- expect(inspect).to.have.property(
211
- 'default',
212
- preferences[PreferenceScope.Default][propertyName]
213
- );
214
- expect(inspect.default).to.equal(preferences[PreferenceScope.Default][propertyName]);
215
- });
216
-
217
- it('should have correct value of \'user\' property', () => {
218
- expect(inspect).to.have.property(
219
- 'user',
220
- preferences[PreferenceScope.User][propertyName]
221
- );
222
- expect(inspect.user).to.equal(preferences[PreferenceScope.User][propertyName]);
223
- });
224
-
225
- it('should have correct value of \'workspace\' property', () => {
226
- expect(inspect).to.have.property(
227
- 'workspace',
228
- preferences[PreferenceScope.Workspace][propertyName]
229
- );
230
- expect(inspect.workspace).to.equal(preferences[PreferenceScope.Workspace][propertyName]);
231
- });
232
-
233
- it('should have correct value of \'workspaceFolder\' property', () => {
234
- expect(inspect).to.have.property(
235
- 'workspaceFolder',
236
- preferences[PreferenceScope.Folder][project][propertyName]
237
- );
238
- expect(inspect.workspaceFolder).to.equal(preferences[PreferenceScope.Folder][project][propertyName]);
239
- });
240
-
241
- it('should have correct value of \'value\' property', () => {
242
- expect(inspect).to.have.property(
243
- 'value',
244
- preferences[PreferenceScope.Folder][project][propertyName]
245
- );
246
- expect(inspect.value).to.equal(preferences[PreferenceScope.Folder][project][propertyName]);
247
- });
248
-
249
- });
250
-
251
- describe('ConfigurationModel', () => {
252
-
253
- it('check merge', () => {
254
- defaultConfiguration = new ConfigurationModel(
255
- preferences[PreferenceScope.Default],
256
- Object.keys(preferences[PreferenceScope.Default])
257
- );
258
- userConfiguration = new ConfigurationModel(
259
- preferences[PreferenceScope.User],
260
- Object.keys(preferences[PreferenceScope.User])
261
- );
262
- workspaceConfiguration = new ConfigurationModel(
263
- preferences[PreferenceScope.Workspace],
264
- Object.keys(preferences[PreferenceScope.Workspace])
265
- );
266
- const mergedConfiguration = new ConfigurationModel().merge(defaultConfiguration, userConfiguration, workspaceConfiguration);
267
- expect(mergedConfiguration.getValue('tabSize')).to.equal(4);
268
- });
269
-
270
- it('Prototype pollution check', () => {
271
- const payload = JSON.parse('{"__proto__":{"injectedConfigurationPrototype": true}}');
272
- const configurationModel = new ConfigurationModel();
273
- configurationModel.merge(new ConfigurationModel(payload));
274
- const prototypeObject = Object.prototype as any;
275
- expect(prototypeObject.injectedConfigurationPrototype).to.be.an('undefined');
276
- const rawObject = {} as any;
277
- expect(rawObject.injectedConfigurationPrototype).to.be.an('undefined');
278
- });
279
-
280
- it('Prototype constructor pollution check', () => {
281
- const payload = JSON.parse('{"constructor": {"prototype": {"injectedConfigurationConstructorPrototype": true}}}');
282
- const configurationModel = new ConfigurationModel();
283
- configurationModel.merge(new ConfigurationModel(payload));
284
- const prototypeObject = Object.prototype as any;
285
- expect(prototypeObject.injectedConfigurationConstructorPrototype).to.be.an('undefined');
286
- const rawObject = {} as any;
287
- expect(rawObject.injectedConfigurationConstructorPrototype).to.be.an('undefined');
288
- });
289
-
290
- });
291
-
292
- });
@@ -1,167 +0,0 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2019 Red Hat, Inc. 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 WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { WorkspaceExtImpl } from '../workspace';
18
- import { isObject } from '../../common/types';
19
- import cloneDeep = require('lodash.clonedeep');
20
- import { URI } from '@theia/core/shared/vscode-uri';
21
-
22
- /* eslint-disable @typescript-eslint/no-explicit-any */
23
-
24
- export class Configuration {
25
-
26
- private combinedConfig: ConfigurationModel | undefined;
27
- private folderCombinedConfigs: { [resource: string]: ConfigurationModel } = {};
28
-
29
- constructor(
30
- private defaultConfiguration: ConfigurationModel,
31
- private userConfiguration: ConfigurationModel,
32
- private workspaceConfiguration: ConfigurationModel = new ConfigurationModel(),
33
- private folderConfigurations: { [resource: string]: ConfigurationModel } = {},
34
- ) { }
35
-
36
- getValue(section: string | undefined, workspace: WorkspaceExtImpl, resource?: URI): any {
37
- return this.getCombinedResourceConfig(workspace, resource).getValue(section);
38
- }
39
-
40
- inspect<C>(key: string, workspace: WorkspaceExtImpl, resource?: URI): {
41
- default: C,
42
- user: C,
43
- workspace: C | undefined,
44
- workspaceFolder: C | undefined,
45
- value: C,
46
- } {
47
- const combinedConfiguration = this.getCombinedResourceConfig(workspace, resource);
48
- const folderConfiguration = this.getFolderResourceConfig(workspace, resource);
49
- return {
50
- default: this.defaultConfiguration.getValue(key),
51
- user: this.userConfiguration.getValue(key),
52
- workspace: workspace ? this.workspaceConfiguration.getValue(key) : undefined,
53
- workspaceFolder: folderConfiguration ? folderConfiguration.getValue(key) : undefined,
54
- value: combinedConfiguration.getValue(key)
55
- };
56
- }
57
-
58
- private getCombinedResourceConfig(workspace: WorkspaceExtImpl, resource?: URI): ConfigurationModel {
59
- const combinedConfig = this.getCombinedConfig();
60
- if (!workspace || !resource) {
61
- return combinedConfig;
62
- }
63
-
64
- const workspaceFolder = workspace.getWorkspaceFolder(resource);
65
- if (!workspaceFolder) {
66
- return combinedConfig;
67
- }
68
-
69
- return this.getFolderCombinedConfig(workspaceFolder.uri.toString()) || combinedConfig;
70
- }
71
-
72
- private getCombinedConfig(): ConfigurationModel {
73
- if (!this.combinedConfig) {
74
- this.combinedConfig = this.defaultConfiguration.merge(this.userConfiguration, this.workspaceConfiguration);
75
- }
76
- return this.combinedConfig;
77
- }
78
-
79
- private getFolderCombinedConfig(folder: string): ConfigurationModel | undefined {
80
- if (this.folderCombinedConfigs[folder]) {
81
- return this.folderCombinedConfigs[folder];
82
- }
83
-
84
- const combinedConfig = this.getCombinedConfig();
85
- const folderConfig = this.folderConfigurations[folder];
86
- if (!folderConfig) {
87
- return combinedConfig;
88
- }
89
-
90
- const folderCombinedConfig = combinedConfig.merge(folderConfig);
91
- this.folderCombinedConfigs[folder] = folderCombinedConfig;
92
-
93
- return folderCombinedConfig;
94
- }
95
-
96
- private getFolderResourceConfig(workspace: WorkspaceExtImpl, resource?: URI): ConfigurationModel | undefined {
97
- if (!workspace || !resource) {
98
- return;
99
- }
100
-
101
- const workspaceFolder = workspace.getWorkspaceFolder(resource);
102
- if (!workspaceFolder) {
103
- return;
104
- }
105
- return this.folderConfigurations[workspaceFolder.uri.toString()];
106
- }
107
-
108
- }
109
-
110
- export class ConfigurationModel {
111
-
112
- constructor(
113
- private contents: any = Object.create(null),
114
- private keys: string[] = [],
115
- ) { }
116
-
117
- getValue(section?: string): any {
118
- if (!section) {
119
- return this.contents;
120
- }
121
-
122
- const path = section.split('.');
123
- let current = this.contents;
124
- for (let i = 0; i < path.length; i++) {
125
- if (typeof current !== 'object' || current === null) {
126
- return undefined;
127
- }
128
- current = current[path[i]];
129
- }
130
- return current;
131
- }
132
-
133
- merge(...others: ConfigurationModel[]): ConfigurationModel {
134
- const contents = cloneDeep(this.contents);
135
- const allKeys = [...this.keys];
136
-
137
- for (const other of others) {
138
- this.mergeContents(contents, other.contents);
139
- this.mergeKeys(allKeys, other.keys);
140
- }
141
- return new ConfigurationModel(contents, allKeys);
142
- }
143
-
144
- private mergeContents(source: any, target: any): void {
145
- for (const key of Object.keys(target)) {
146
- if (key === '__proto__') {
147
- continue;
148
- }
149
- if (key in source) {
150
- if (isObject(source[key]) && isObject(target[key])) {
151
- this.mergeContents(source[key], target[key]);
152
- continue;
153
- }
154
- }
155
- source[key] = cloneDeep(target[key]);
156
- }
157
- }
158
-
159
- private mergeKeys(source: string[], target: string[]): void {
160
- for (const key of target) {
161
- if (source.indexOf(key) === -1) {
162
- source.push(key);
163
- }
164
- }
165
- }
166
-
167
- }