@theia/preferences 1.57.1 → 1.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/preferences-json-schema-contribution.d.ts +9 -8
- package/lib/browser/preferences-json-schema-contribution.d.ts.map +1 -1
- package/lib/browser/preferences-json-schema-contribution.js +10 -10
- package/lib/browser/preferences-json-schema-contribution.js.map +1 -1
- package/package.json +10 -10
- package/src/browser/preferences-json-schema-contribution.ts +14 -15
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import
|
|
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
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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":"
|
|
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
|
|
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.
|
|
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.
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
54
|
-
this.
|
|
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,
|
|
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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AAC,SAAS,CAAC,EAC9E,IAAI,CAAC,eAAe,CAAC,CAAC,yBAAe,CAAC,SAAS,CAAC,CAAC,CAAC;QACtD,IAAI,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"}
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/preferences",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.58.0",
|
|
4
4
|
"description": "Theia - Preferences Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.
|
|
7
|
-
"@theia/editor": "1.
|
|
8
|
-
"@theia/filesystem": "1.
|
|
9
|
-
"@theia/monaco": "1.
|
|
10
|
-
"@theia/monaco-editor-core": "1.
|
|
11
|
-
"@theia/userstorage": "1.
|
|
12
|
-
"@theia/workspace": "1.
|
|
6
|
+
"@theia/core": "1.58.0",
|
|
7
|
+
"@theia/editor": "1.58.0",
|
|
8
|
+
"@theia/filesystem": "1.58.0",
|
|
9
|
+
"@theia/monaco": "1.58.0",
|
|
10
|
+
"@theia/monaco-editor-core": "1.96.302",
|
|
11
|
+
"@theia/userstorage": "1.58.0",
|
|
12
|
+
"@theia/workspace": "1.58.0",
|
|
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.
|
|
53
|
+
"@theia/ext-scripts": "1.58.0"
|
|
54
54
|
},
|
|
55
55
|
"nyc": {
|
|
56
56
|
"extends": "../../configs/nyc.json"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "6594f32b9727aea20d88934bf386dee06d08fa5e"
|
|
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 {
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
68
|
-
this.
|
|
66
|
+
protected updateInMemoryResources(): void {
|
|
67
|
+
this.jsonSchemaData.setSchema(this.getSchemaURIForScope(PreferenceScope.Default),
|
|
69
68
|
this.serializeSchema(+PreferenceScope.Default));
|
|
70
|
-
this.
|
|
69
|
+
this.jsonSchemaData.setSchema(this.getSchemaURIForScope(PreferenceScope.User),
|
|
71
70
|
this.serializeSchema(+PreferenceScope.User));
|
|
72
|
-
this.
|
|
71
|
+
this.jsonSchemaData.setSchema(this.getSchemaURIForScope(PreferenceScope.Workspace),
|
|
73
72
|
this.serializeSchema(+PreferenceScope.Workspace));
|
|
74
|
-
this.
|
|
73
|
+
this.jsonSchemaData.setSchema(this.getSchemaURIForScope(PreferenceScope.Folder),
|
|
75
74
|
this.serializeSchema(+PreferenceScope.Folder));
|
|
76
75
|
}
|
|
77
76
|
|
|
78
|
-
|
|
77
|
+
protected getSchemaURIForScope(scope: PreferenceScope): URI {
|
|
79
78
|
return new URI(PREFERENCE_URI_PREFIX + PreferenceScope[scope].toLowerCase());
|
|
80
79
|
}
|
|
81
80
|
|
|
82
|
-
|
|
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
|
}
|