@theia/preferences 1.56.0 → 1.57.0-next.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,12 +13,14 @@
13
13
  ## Description
14
14
 
15
15
  The `@theia/preferences` extension implements the preferences API defined in `@theia/core`, including the four preference providers:
16
+
16
17
  - `Default` Preference, which serves as default values of preferences,
17
18
  - `User` Preference for the user home directory, which has precedence over the default values,
18
19
  - `Workspace` Preference for the workspace, which has precedence over User Preference, and
19
20
  - `Folder` Preference for the root folder, which has precedence over the Workspace Preference
20
21
 
21
22
  To set:
23
+
22
24
  - `User` Preferences: Create or edit a `settings.json` under the `.theia` folder located either in the user home.
23
25
  - `Workspace` Preference: If one folder is opened as the workspace, create or edit a `settings.json` under the root of the workspace. If a multi-root workspace is opened, create or edit the "settings" property in the workspace file.
24
26
  - `Folder` Preferences: Create or edit a `settings.json` under any of the root folders.
@@ -28,10 +30,10 @@ Example of a `settings.json` below:
28
30
  ```typescript
29
31
  {
30
32
  // Enable/Disable the line numbers in the monaco editor
31
- "editor.lineNumbers": "off",
33
+ "editor.lineNumbers": "off",
32
34
  // Tab width in the editor
33
- "editor.tabSize": 4,
34
- "files.watcherExclude": "path/to/file"
35
+ "editor.tabSize": 4,
36
+ "files.watcherExclude": "path/to/file"
35
37
  }
36
38
  ```
37
39
 
@@ -42,16 +44,16 @@ Example of a workspace file below:
42
44
  "folders": [
43
45
  {
44
46
  "path": "file:///home/username/helloworld"
45
- },
46
- {
47
+ },
48
+ {
47
49
  "path": "file:///home/username/dev/byeworld"
48
50
  }
49
51
  ],
50
52
  "settings": {
51
53
  // Enable/Disable the line numbers in the monaco editor
52
- "editor.lineNumbers": "off",
54
+ "editor.lineNumbers": "off",
53
55
  // Tab width in the editor
54
- "editor.tabSize": 4,
56
+ "editor.tabSize": 4,
55
57
  }
56
58
  }
57
59
  ```
@@ -68,14 +70,13 @@ Example of a workspace file below:
68
70
  - [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
69
71
 
70
72
  ## Trademark
71
- "Theia" is a trademark of the Eclipse Foundation
72
- https://www.eclipse.org/theia
73
73
 
74
+ "Theia" is a trademark of the Eclipse Foundation
75
+ <https://www.eclipse.org/theia>
74
76
 
75
77
  # Theia - Preferences Extension
76
78
 
77
-
78
-
79
79
  ## License
80
+
80
81
  - [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
81
82
  - [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
@@ -1,18 +1,19 @@
1
- import { InMemoryResources } from '@theia/core';
2
- import { JsonSchemaRegisterContext, JsonSchemaContribution } from '@theia/core/lib/browser/json-schema-store';
1
+ import URI from '@theia/core/lib/common/uri';
2
+ import { JsonSchemaRegisterContext, JsonSchemaContribution, JsonSchemaDataStore } from '@theia/core/lib/browser/json-schema-store';
3
3
  import { PreferenceSchemaProvider } from '@theia/core/lib/browser/preferences/preference-contribution';
4
4
  import { PreferenceConfigurations } from '@theia/core/lib/browser/preferences/preference-configurations';
5
+ import { PreferenceScope } from '@theia/core/lib/browser';
5
6
  import { WorkspaceService } from '@theia/workspace/lib/browser';
6
7
  export declare class PreferencesJsonSchemaContribution implements JsonSchemaContribution {
7
- private serializeSchema;
8
+ protected serializeSchema: (scope: PreferenceScope) => string;
8
9
  protected readonly schemaProvider: PreferenceSchemaProvider;
9
- protected readonly inmemoryResources: InMemoryResources;
10
10
  protected readonly preferenceConfigurations: PreferenceConfigurations;
11
+ protected readonly jsonSchemaData: JsonSchemaDataStore;
11
12
  protected readonly workspaceService: WorkspaceService;
12
13
  registerSchemas(context: JsonSchemaRegisterContext): void;
13
- private registerSchema;
14
- private updateInMemoryResources;
15
- private getSchemaURIForScope;
16
- private getFileMatch;
14
+ protected registerSchema(scope: PreferenceScope, context: JsonSchemaRegisterContext): void;
15
+ protected updateInMemoryResources(): void;
16
+ protected getSchemaURIForScope(scope: PreferenceScope): URI;
17
+ protected getFileMatch(scope: string): string[];
17
18
  }
18
19
  //# sourceMappingURL=preferences-json-schema-contribution.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"preferences-json-schema-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/preferences-json-schema-contribution.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AAC9G,OAAO,EAAE,wBAAwB,EAAE,MAAM,6DAA6D,CAAC;AACvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,+DAA+D,CAAC;AAEzG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAKhE,qBACa,iCAAkC,YAAW,sBAAsB;IAC5E,OAAO,CAAC,eAAe,CAAoF;IAG3G,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,wBAAwB,CAAC;IAG5D,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAGxD,SAAS,CAAC,QAAQ,CAAC,wBAAwB,EAAE,wBAAwB,CAAC;IAGtE,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAEtD,eAAe,CAAC,OAAO,EAAE,yBAAyB,GAAG,IAAI;IAUzD,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,uBAAuB;IAW/B,OAAO,CAAC,oBAAoB;IAI5B,OAAO,CAAC,YAAY;CAIvB"}
1
+ {"version":3,"file":"preferences-json-schema-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/preferences-json-schema-contribution.ts"],"names":[],"mappings":"AAiBA,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACnI,OAAO,EAAE,wBAAwB,EAAE,MAAM,6DAA6D,CAAC;AACvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,+DAA+D,CAAC;AACzG,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAKhE,qBACa,iCAAkC,YAAW,sBAAsB;IAC5E,SAAS,CAAC,eAAe,UAAW,eAAe,YAA0D;IAG7G,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,wBAAwB,CAAC;IAG5D,SAAS,CAAC,QAAQ,CAAC,wBAAwB,EAAE,wBAAwB,CAAC;IAGtE,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,mBAAmB,CAAC;IAGvD,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAEtD,eAAe,CAAC,OAAO,EAAE,yBAAyB,GAAG,IAAI;IAUzD,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,yBAAyB,GAAG,IAAI;IAY1F,SAAS,CAAC,uBAAuB,IAAI,IAAI;IAWzC,SAAS,CAAC,oBAAoB,CAAC,KAAK,EAAE,eAAe,GAAG,GAAG;IAI3D,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;CAIlD"}
@@ -19,7 +19,7 @@ exports.PreferencesJsonSchemaContribution = void 0;
19
19
  const tslib_1 = require("tslib");
20
20
  const inversify_1 = require("@theia/core/shared/inversify");
21
21
  const uri_1 = require("@theia/core/lib/common/uri");
22
- const core_1 = require("@theia/core");
22
+ const json_schema_store_1 = require("@theia/core/lib/browser/json-schema-store");
23
23
  const preference_contribution_1 = require("@theia/core/lib/browser/preferences/preference-contribution");
24
24
  const preference_configurations_1 = require("@theia/core/lib/browser/preferences/preference-configurations");
25
25
  const browser_1 = require("@theia/core/lib/browser");
@@ -41,17 +41,17 @@ let PreferencesJsonSchemaContribution = class PreferencesJsonSchemaContribution
41
41
  registerSchema(scope, context) {
42
42
  const scopeStr = browser_1.PreferenceScope[scope].toLowerCase();
43
43
  const uri = new uri_1.default(PREFERENCE_URI_PREFIX + scopeStr);
44
- this.inmemoryResources.add(uri, this.serializeSchema(scope));
44
+ this.jsonSchemaData.setSchema(uri, this.serializeSchema(scope));
45
45
  context.registerSchema({
46
46
  fileMatch: this.getFileMatch(scopeStr),
47
47
  url: uri.toString()
48
48
  });
49
49
  }
50
50
  updateInMemoryResources() {
51
- this.inmemoryResources.update(this.getSchemaURIForScope(browser_1.PreferenceScope.Default), this.serializeSchema(+browser_1.PreferenceScope.Default));
52
- this.inmemoryResources.update(this.getSchemaURIForScope(browser_1.PreferenceScope.User), this.serializeSchema(+browser_1.PreferenceScope.User));
53
- this.inmemoryResources.update(this.getSchemaURIForScope(browser_1.PreferenceScope.Workspace), this.serializeSchema(+browser_1.PreferenceScope.Workspace));
54
- this.inmemoryResources.update(this.getSchemaURIForScope(browser_1.PreferenceScope.Folder), this.serializeSchema(+browser_1.PreferenceScope.Folder));
51
+ this.jsonSchemaData.setSchema(this.getSchemaURIForScope(browser_1.PreferenceScope.Default), this.serializeSchema(+browser_1.PreferenceScope.Default));
52
+ this.jsonSchemaData.setSchema(this.getSchemaURIForScope(browser_1.PreferenceScope.User), this.serializeSchema(+browser_1.PreferenceScope.User));
53
+ this.jsonSchemaData.setSchema(this.getSchemaURIForScope(browser_1.PreferenceScope.Workspace), this.serializeSchema(+browser_1.PreferenceScope.Workspace));
54
+ this.jsonSchemaData.setSchema(this.getSchemaURIForScope(browser_1.PreferenceScope.Folder), this.serializeSchema(+browser_1.PreferenceScope.Folder));
55
55
  }
56
56
  getSchemaURIForScope(scope) {
57
57
  return new uri_1.default(PREFERENCE_URI_PREFIX + browser_1.PreferenceScope[scope].toLowerCase());
@@ -66,14 +66,14 @@ tslib_1.__decorate([
66
66
  (0, inversify_1.inject)(preference_contribution_1.PreferenceSchemaProvider),
67
67
  tslib_1.__metadata("design:type", preference_contribution_1.PreferenceSchemaProvider)
68
68
  ], PreferencesJsonSchemaContribution.prototype, "schemaProvider", void 0);
69
- tslib_1.__decorate([
70
- (0, inversify_1.inject)(core_1.InMemoryResources),
71
- tslib_1.__metadata("design:type", core_1.InMemoryResources)
72
- ], PreferencesJsonSchemaContribution.prototype, "inmemoryResources", void 0);
73
69
  tslib_1.__decorate([
74
70
  (0, inversify_1.inject)(preference_configurations_1.PreferenceConfigurations),
75
71
  tslib_1.__metadata("design:type", preference_configurations_1.PreferenceConfigurations)
76
72
  ], PreferencesJsonSchemaContribution.prototype, "preferenceConfigurations", void 0);
73
+ tslib_1.__decorate([
74
+ (0, inversify_1.inject)(json_schema_store_1.JsonSchemaDataStore),
75
+ tslib_1.__metadata("design:type", json_schema_store_1.JsonSchemaDataStore)
76
+ ], PreferencesJsonSchemaContribution.prototype, "jsonSchemaData", void 0);
77
77
  tslib_1.__decorate([
78
78
  (0, inversify_1.inject)(browser_2.WorkspaceService),
79
79
  tslib_1.__metadata("design:type", browser_2.WorkspaceService)
@@ -1 +1 @@
1
- {"version":3,"file":"preferences-json-schema-contribution.js","sourceRoot":"","sources":["../../src/browser/preferences-json-schema-contribution.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAkE;AAClE,oDAA6C;AAC7C,sCAAgD;AAEhD,yGAAuG;AACvG,6GAAyG;AACzG,qDAA0D;AAC1D,0DAAgE;AAEhE,MAAM,qBAAqB,GAAG,4BAA4B,CAAC;AAC3D,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AAGtC,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IAAvC;QACK,oBAAe,GAAG,CAAC,KAAs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A,kBAAM,EAAC,oDAAwB,CAAC;sCACY,oDAAwB;mFAAC;AAGnD;IADlB,IAAA,kBAAM,EAAC,0BAAgB,CAAC;sCACY,0BAAgB;2EAAC;4CAb7C,iCAAiC;IAD7C,IAAA,sBAAU,GAAE;GACA,iCAAiC,CAwD7C"}
1
+ {"version":3,"file":"preferences-json-schema-contribution.js","sourceRoot":"","sources":["../../src/browser/preferences-json-schema-contribution.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAkE;AAClE,oDAA6C;AAC7C,iFAAmI;AACnI,yGAAuG;AACvG,6GAAyG;AACzG,qDAA0D;AAC1D,0DAAgE;AAEhE,MAAM,qBAAqB,GAAG,4BAA4B,CAAC;AAC3D,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AAGtC,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IAAvC;QACO,oBAAe,GAAG,CAAC,KAAsB,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAuDjH,CAAC;IAzCG,eAAe,CAAC,OAAkC;QAC9C,IAAI,CAAC,cAAc,CAAC,yBAAe,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACtD,IAAI,CAAC,cAAc,CAAC,yBAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACnD,IAAI,CAAC,cAAc,CAAC,yBAAe,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACxD,IAAI,CAAC,cAAc,CAAC,yBAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAErD,IAAI,CAAC,gBAAgB,CA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CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,oBAAoB,CAAC,yBAAe,CAAC,MAAM,CAAC,EAC3E,IAAI,CAAC,eAAe,CAAC,CAAC,yBAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IACvD,CAAC;IAES,oBAAoB,CAAC,KAAsB;QACjD,OAAO,IAAI,aAAG,CAAC,qBAAqB,GAAG,yBAAe,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IACjF,CAAC;IAES,YAAY,CAAC,KAAa;QAChC,MAAM,QAAQ,GAAG,IAAI,CAAC,wBAAwB,CAAC,aAAa,EAAE,GAAG,OAAO,CAAC;QACzE,OAAO,CAAC,QAAQ,EAAE,IAAI,aAAG,CAAC,mBAAmB,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IACzF,CAAC;CACJ,CAAA;AAxDY,8EAAiC;AAIvB;IADlB,IAAA,kBAAM,EAAC,kDAAwB,CAAC;sCACE,kDAAwB;yEAAC;AAGzC;IADlB,IAAA,kBAAM,EAAC,oDAAwB,CAAC;sCACY,oDAAwB;mFAAC;AAGnD;IADlB,IAAA,kBAAM,EAAC,uCAAmB,CAAC;sCACO,uCAAmB;yEAAC;AAGpC;IADlB,IAAA,kBAAM,EAAC,0BAAgB,CAAC;sCACY,0BAAgB;2EAAC;4CAb7C,iCAAiC;IAD7C,IAAA,sBAAU,GAAE;GACA,iCAAiC,CAwD7C"}
@@ -52,7 +52,7 @@ export declare class PreferencesEditorWidget extends BaseWidget implements State
52
52
  protected resetScroll(nodeIDToScrollTo?: string, filterWasCleared?: boolean): void;
53
53
  protected doResetScroll(nodeIDToScrollTo?: string, filterWasCleared?: boolean): void;
54
54
  protected doOnScroll(): void;
55
- onScroll: import("lodash").DebouncedFunc<any>;
55
+ onScroll: import("lodash").DebouncedFuncLeading<any>;
56
56
  protected findFirstVisibleChildID(): string | undefined;
57
57
  protected setFirstVisibleChildID(id?: string): void;
58
58
  protected handleSelectionChange(selectionEvent: readonly Readonly<SelectableTreeNode>[]): void;
@@ -1 +1 @@
1
- {"version":3,"file":"preference-editor-widget.d.ts","sourceRoot":"","sources":["../../../src/browser/views/preference-editor-widget.ts"],"names":[],"mappings":";AAoBA,OAAO,EACH,iBAAiB,EAEjB,kBAAkB,EAClB,cAAc,EAEd,iBAAiB,EAEjB,wBAAwB,EAC3B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,UAAU,EAA0B,MAAM,wCAAwC,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAgC,MAAM,0BAA0B,CAAC;AAC1H,OAAO,EAAE,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACrH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,qCAAqC,EAAE,MAAM,+CAA+C,CAAC;AAGtG,MAAM,WAAW,sBAAsB;IACnC,mBAAmB,EAAE,MAAM,CAAC;CAC/B;AAED,qBACa,uBAAwB,SAAQ,UAAW,YAAW,cAAc;IAC7E,MAAM,CAAC,QAAQ,CAAC,EAAE,qBAAqB;IACvC,MAAM,CAAC,QAAQ,CAAC,KAAK,qBAAqB;IAEjC,aAAa,8CAA0B;IAEhD,SAAS,CAAC,eAAe,EAAE,cAAc,CAAC;IAC1C;;OAEG;IACH,SAAS,CAAC,uBAAuB,SAAM;IACvC;;OAEG;IACH,SAAS,CAAC,iBAAiB,SAAM;IACjC,SAAS,CAAC,aAAa,UAAQ;IAC/B,SAAS,CAAC,mBAAmB,SAAM;IACnC,SAAS,CAAC,SAAS,6CAAoD;IACvE,SAAS,CAAC,kBAAkB,sBAA6B;IAEzD,SAAS,CAAC,qBAAqB,6CAAoD;IAExD,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IACtD,SA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AAE;cAM1H,kBAAkB,IAAI,WAAW;IAIpD,UAAU,IAAI,sBAAsB;IAMpC,YAAY,CAAC,QAAQ,EAAE,sBAAsB,GAAG,IAAI;CAIvD"}
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@theia/preferences",
3
- "version": "1.56.0",
3
+ "version": "1.57.0-next.112+f4778c273",
4
4
  "description": "Theia - Preferences Extension",
5
5
  "dependencies": {
6
- "@theia/core": "1.56.0",
7
- "@theia/editor": "1.56.0",
8
- "@theia/filesystem": "1.56.0",
9
- "@theia/monaco": "1.56.0",
10
- "@theia/monaco-editor-core": "1.83.101",
11
- "@theia/userstorage": "1.56.0",
12
- "@theia/workspace": "1.56.0",
6
+ "@theia/core": "1.57.0-next.112+f4778c273",
7
+ "@theia/editor": "1.57.0-next.112+f4778c273",
8
+ "@theia/filesystem": "1.57.0-next.112+f4778c273",
9
+ "@theia/monaco": "1.57.0-next.112+f4778c273",
10
+ "@theia/monaco-editor-core": "1.96.302",
11
+ "@theia/userstorage": "1.57.0-next.112+f4778c273",
12
+ "@theia/workspace": "1.57.0-next.112+f4778c273",
13
13
  "async-mutex": "^0.3.1",
14
14
  "fast-deep-equal": "^3.1.3",
15
15
  "jsonc-parser": "^2.2.0",
@@ -50,10 +50,10 @@
50
50
  "watch": "theiaext watch"
51
51
  },
52
52
  "devDependencies": {
53
- "@theia/ext-scripts": "1.56.0"
53
+ "@theia/ext-scripts": "1.58.0"
54
54
  },
55
55
  "nyc": {
56
56
  "extends": "../../configs/nyc.json"
57
57
  },
58
- "gitHead": "3b4498f8f1c66be688847418fcc35595282671dc"
58
+ "gitHead": "f4778c2737bb75613f0e1f99da8996bad91f6e17"
59
59
  }
@@ -16,8 +16,7 @@
16
16
 
17
17
  import { inject, injectable } from '@theia/core/shared/inversify';
18
18
  import URI from '@theia/core/lib/common/uri';
19
- import { InMemoryResources } from '@theia/core';
20
- import { JsonSchemaRegisterContext, JsonSchemaContribution } from '@theia/core/lib/browser/json-schema-store';
19
+ import { JsonSchemaRegisterContext, JsonSchemaContribution, JsonSchemaDataStore } from '@theia/core/lib/browser/json-schema-store';
21
20
  import { PreferenceSchemaProvider } from '@theia/core/lib/browser/preferences/preference-contribution';
22
21
  import { PreferenceConfigurations } from '@theia/core/lib/browser/preferences/preference-configurations';
23
22
  import { PreferenceScope } from '@theia/core/lib/browser';
@@ -28,17 +27,17 @@ const USER_STORAGE_PREFIX = 'user-storage:/';
28
27
 
29
28
  @injectable()
30
29
  export class PreferencesJsonSchemaContribution implements JsonSchemaContribution {
31
- private serializeSchema = (scope: PreferenceScope) => JSON.stringify(this.schemaProvider.getSchema(scope));
30
+ protected serializeSchema = (scope: PreferenceScope) => JSON.stringify(this.schemaProvider.getSchema(scope));
32
31
 
33
32
  @inject(PreferenceSchemaProvider)
34
33
  protected readonly schemaProvider: PreferenceSchemaProvider;
35
34
 
36
- @inject(InMemoryResources)
37
- protected readonly inmemoryResources: InMemoryResources;
38
-
39
35
  @inject(PreferenceConfigurations)
40
36
  protected readonly preferenceConfigurations: PreferenceConfigurations;
41
37
 
38
+ @inject(JsonSchemaDataStore)
39
+ protected readonly jsonSchemaData: JsonSchemaDataStore;
40
+
42
41
  @inject(WorkspaceService)
43
42
  protected readonly workspaceService: WorkspaceService;
44
43
 
@@ -52,11 +51,11 @@ export class PreferencesJsonSchemaContribution implements JsonSchemaContribution
52
51
  this.schemaProvider.onDidPreferenceSchemaChanged(() => this.updateInMemoryResources());
53
52
  }
54
53
 
55
- private registerSchema(scope: PreferenceScope, context: JsonSchemaRegisterContext): void {
54
+ protected registerSchema(scope: PreferenceScope, context: JsonSchemaRegisterContext): void {
56
55
  const scopeStr = PreferenceScope[scope].toLowerCase();
57
56
  const uri = new URI(PREFERENCE_URI_PREFIX + scopeStr);
58
57
 
59
- this.inmemoryResources.add(uri, this.serializeSchema(scope));
58
+ this.jsonSchemaData.setSchema(uri, this.serializeSchema(scope));
60
59
 
61
60
  context.registerSchema({
62
61
  fileMatch: this.getFileMatch(scopeStr),
@@ -64,22 +63,22 @@ export class PreferencesJsonSchemaContribution implements JsonSchemaContribution
64
63
  });
65
64
  }
66
65
 
67
- private updateInMemoryResources(): void {
68
- this.inmemoryResources.update(this.getSchemaURIForScope(PreferenceScope.Default),
66
+ protected updateInMemoryResources(): void {
67
+ this.jsonSchemaData.setSchema(this.getSchemaURIForScope(PreferenceScope.Default),
69
68
  this.serializeSchema(+PreferenceScope.Default));
70
- this.inmemoryResources.update(this.getSchemaURIForScope(PreferenceScope.User),
69
+ this.jsonSchemaData.setSchema(this.getSchemaURIForScope(PreferenceScope.User),
71
70
  this.serializeSchema(+PreferenceScope.User));
72
- this.inmemoryResources.update(this.getSchemaURIForScope(PreferenceScope.Workspace),
71
+ this.jsonSchemaData.setSchema(this.getSchemaURIForScope(PreferenceScope.Workspace),
73
72
  this.serializeSchema(+PreferenceScope.Workspace));
74
- this.inmemoryResources.update(this.getSchemaURIForScope(PreferenceScope.Folder),
73
+ this.jsonSchemaData.setSchema(this.getSchemaURIForScope(PreferenceScope.Folder),
75
74
  this.serializeSchema(+PreferenceScope.Folder));
76
75
  }
77
76
 
78
- private getSchemaURIForScope(scope: PreferenceScope): URI {
77
+ protected getSchemaURIForScope(scope: PreferenceScope): URI {
79
78
  return new URI(PREFERENCE_URI_PREFIX + PreferenceScope[scope].toLowerCase());
80
79
  }
81
80
 
82
- private getFileMatch(scope: string): string[] {
81
+ protected getFileMatch(scope: string): string[] {
83
82
  const baseName = this.preferenceConfigurations.getConfigName() + '.json';
84
83
  return [baseName, new URI(USER_STORAGE_PREFIX + scope).resolve(baseName).toString()];
85
84
  }