@theia/preferences 1.67.0-next.3 → 1.67.0-next.56
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 +1 -1
- package/package.json +8 -8
- package/src/browser/views/components/preference-markdown-renderer.ts +2 -1
- package/src/browser/views/preference-editor-widget.ts +14 -3
- package/src/browser/workspace-preference-provider.ts +3 -2
- package/lib/browser/folder-preference-provider.d.ts +0 -23
- package/lib/browser/folder-preference-provider.d.ts.map +0 -1
- package/lib/browser/folder-preference-provider.js +0 -57
- package/lib/browser/folder-preference-provider.js.map +0 -1
- package/lib/browser/folders-preferences-provider.d.ts +0 -27
- package/lib/browser/folders-preferences-provider.d.ts.map +0 -1
- package/lib/browser/folders-preferences-provider.js +0 -237
- package/lib/browser/folders-preferences-provider.js.map +0 -1
- package/lib/browser/frontend-preference-storage.d.ts +0 -20
- package/lib/browser/frontend-preference-storage.d.ts.map +0 -1
- package/lib/browser/frontend-preference-storage.js +0 -63
- package/lib/browser/frontend-preference-storage.js.map +0 -1
- package/lib/browser/index.d.ts +0 -5
- package/lib/browser/index.d.ts.map +0 -1
- package/lib/browser/index.js +0 -23
- package/lib/browser/index.js.map +0 -1
- package/lib/browser/monaco-jsonc-editor.d.ts +0 -10
- package/lib/browser/monaco-jsonc-editor.d.ts.map +0 -1
- package/lib/browser/monaco-jsonc-editor.js +0 -73
- package/lib/browser/monaco-jsonc-editor.js.map +0 -1
- package/lib/browser/package.spec.d.ts +0 -1
- package/lib/browser/package.spec.d.ts.map +0 -1
- package/lib/browser/package.spec.js +0 -26
- package/lib/browser/package.spec.js.map +0 -1
- package/lib/browser/preference-bindings.d.ts +0 -4
- package/lib/browser/preference-bindings.d.ts.map +0 -1
- package/lib/browser/preference-bindings.js +0 -49
- package/lib/browser/preference-bindings.js.map +0 -1
- package/lib/browser/preference-frontend-contribution.d.ts +0 -9
- package/lib/browser/preference-frontend-contribution.d.ts.map +0 -1
- package/lib/browser/preference-frontend-contribution.js +0 -45
- package/lib/browser/preference-frontend-contribution.js.map +0 -1
- package/lib/browser/preference-frontend-module.d.ts +0 -7
- package/lib/browser/preference-frontend-module.d.ts.map +0 -1
- package/lib/browser/preference-frontend-module.js +0 -67
- package/lib/browser/preference-frontend-module.js.map +0 -1
- package/lib/browser/preference-open-handler.d.ts +0 -10
- package/lib/browser/preference-open-handler.d.ts.map +0 -1
- package/lib/browser/preference-open-handler.js +0 -57
- package/lib/browser/preference-open-handler.js.map +0 -1
- package/lib/browser/preference-transaction-manager.d.ts +0 -98
- package/lib/browser/preference-transaction-manager.d.ts.map +0 -1
- package/lib/browser/preference-transaction-manager.js +0 -279
- package/lib/browser/preference-transaction-manager.js.map +0 -1
- package/lib/browser/preference-tree-model.d.ts +0 -60
- package/lib/browser/preference-tree-model.d.ts.map +0 -1
- package/lib/browser/preference-tree-model.js +0 -247
- package/lib/browser/preference-tree-model.js.map +0 -1
- package/lib/browser/preferences-contribution.d.ts +0 -35
- package/lib/browser/preferences-contribution.d.ts.map +0 -1
- package/lib/browser/preferences-contribution.js +0 -263
- package/lib/browser/preferences-contribution.js.map +0 -1
- package/lib/browser/preferences-json-schema-contribution.d.ts +0 -17
- package/lib/browser/preferences-json-schema-contribution.d.ts.map +0 -1
- package/lib/browser/preferences-json-schema-contribution.js +0 -84
- package/lib/browser/preferences-json-schema-contribution.js.map +0 -1
- package/lib/browser/preferences-monaco-contribution.d.ts +0 -2
- package/lib/browser/preferences-monaco-contribution.d.ts.map +0 -1
- package/lib/browser/preferences-monaco-contribution.js +0 -28
- package/lib/browser/preferences-monaco-contribution.js.map +0 -1
- package/lib/browser/util/preference-layout.d.ts +0 -23
- package/lib/browser/util/preference-layout.d.ts.map +0 -1
- package/lib/browser/util/preference-layout.js +0 -441
- package/lib/browser/util/preference-layout.js.map +0 -1
- package/lib/browser/util/preference-scope-command-manager.d.ts +0 -18
- package/lib/browser/util/preference-scope-command-manager.d.ts.map +0 -1
- package/lib/browser/util/preference-scope-command-manager.js +0 -80
- package/lib/browser/util/preference-scope-command-manager.js.map +0 -1
- package/lib/browser/util/preference-tree-generator.d.ts +0 -48
- package/lib/browser/util/preference-tree-generator.d.ts.map +0 -1
- package/lib/browser/util/preference-tree-generator.js +0 -277
- package/lib/browser/util/preference-tree-generator.js.map +0 -1
- package/lib/browser/util/preference-tree-label-provider.d.ts +0 -12
- package/lib/browser/util/preference-tree-label-provider.d.ts.map +0 -1
- package/lib/browser/util/preference-tree-label-provider.js +0 -74
- package/lib/browser/util/preference-tree-label-provider.js.map +0 -1
- package/lib/browser/util/preference-tree-label-provider.spec.d.ts +0 -2
- package/lib/browser/util/preference-tree-label-provider.spec.d.ts.map +0 -1
- package/lib/browser/util/preference-tree-label-provider.spec.js +0 -90
- package/lib/browser/util/preference-tree-label-provider.spec.js.map +0 -1
- package/lib/browser/util/preference-types.d.ts +0 -69
- package/lib/browser/util/preference-types.d.ts.map +0 -1
- package/lib/browser/util/preference-types.js +0 -133
- package/lib/browser/util/preference-types.js.map +0 -1
- package/lib/browser/views/components/preference-array-input.d.ts +0 -29
- package/lib/browser/views/components/preference-array-input.d.ts.map +0 -1
- package/lib/browser/views/components/preference-array-input.js +0 -176
- package/lib/browser/views/components/preference-array-input.js.map +0 -1
- package/lib/browser/views/components/preference-boolean-input.d.ts +0 -18
- package/lib/browser/views/components/preference-boolean-input.d.ts.map +0 -1
- package/lib/browser/views/components/preference-boolean-input.js +0 -75
- package/lib/browser/views/components/preference-boolean-input.js.map +0 -1
- package/lib/browser/views/components/preference-file-input.d.ts +0 -30
- package/lib/browser/views/components/preference-file-input.d.ts.map +0 -1
- package/lib/browser/views/components/preference-file-input.js +0 -103
- package/lib/browser/views/components/preference-file-input.js.map +0 -1
- package/lib/browser/views/components/preference-json-input.d.ts +0 -20
- package/lib/browser/views/components/preference-json-input.d.ts.map +0 -1
- package/lib/browser/views/components/preference-json-input.js +0 -86
- package/lib/browser/views/components/preference-json-input.js.map +0 -1
- package/lib/browser/views/components/preference-markdown-renderer.d.ts +0 -15
- package/lib/browser/views/components/preference-markdown-renderer.d.ts.map +0 -1
- package/lib/browser/views/components/preference-markdown-renderer.js +0 -85
- package/lib/browser/views/components/preference-markdown-renderer.js.map +0 -1
- package/lib/browser/views/components/preference-node-renderer-creator.d.ts +0 -49
- package/lib/browser/views/components/preference-node-renderer-creator.d.ts.map +0 -1
- package/lib/browser/views/components/preference-node-renderer-creator.js +0 -122
- package/lib/browser/views/components/preference-node-renderer-creator.js.map +0 -1
- package/lib/browser/views/components/preference-node-renderer.d.ts +0 -118
- package/lib/browser/views/components/preference-node-renderer.d.ts.map +0 -1
- package/lib/browser/views/components/preference-node-renderer.js +0 -442
- package/lib/browser/views/components/preference-node-renderer.js.map +0 -1
- package/lib/browser/views/components/preference-null-input.d.ts +0 -16
- package/lib/browser/views/components/preference-null-input.d.ts.map +0 -1
- package/lib/browser/views/components/preference-null-input.js +0 -59
- package/lib/browser/views/components/preference-null-input.js.map +0 -1
- package/lib/browser/views/components/preference-number-input.d.ts +0 -35
- package/lib/browser/views/components/preference-number-input.d.ts.map +0 -1
- package/lib/browser/views/components/preference-number-input.js +0 -174
- package/lib/browser/views/components/preference-number-input.js.map +0 -1
- package/lib/browser/views/components/preference-select-input.d.ts +0 -29
- package/lib/browser/views/components/preference-select-input.d.ts.map +0 -1
- package/lib/browser/views/components/preference-select-input.js +0 -131
- package/lib/browser/views/components/preference-select-input.js.map +0 -1
- package/lib/browser/views/components/preference-string-input.d.ts +0 -18
- package/lib/browser/views/components/preference-string-input.d.ts.map +0 -1
- package/lib/browser/views/components/preference-string-input.js +0 -85
- package/lib/browser/views/components/preference-string-input.js.map +0 -1
- package/lib/browser/views/preference-editor-widget.d.ts +0 -73
- package/lib/browser/views/preference-editor-widget.d.ts.map +0 -1
- package/lib/browser/views/preference-editor-widget.js +0 -376
- package/lib/browser/views/preference-editor-widget.js.map +0 -1
- package/lib/browser/views/preference-scope-tabbar-widget.d.ts +0 -55
- package/lib/browser/views/preference-scope-tabbar-widget.d.ts.map +0 -1
- package/lib/browser/views/preference-scope-tabbar-widget.js +0 -337
- package/lib/browser/views/preference-scope-tabbar-widget.js.map +0 -1
- package/lib/browser/views/preference-searchbar-widget.d.ts +0 -54
- package/lib/browser/views/preference-searchbar-widget.d.ts.map +0 -1
- package/lib/browser/views/preference-searchbar-widget.js +0 -163
- package/lib/browser/views/preference-searchbar-widget.js.map +0 -1
- package/lib/browser/views/preference-tree-widget.d.ts +0 -20
- package/lib/browser/views/preference-tree-widget.d.ts.map +0 -1
- package/lib/browser/views/preference-tree-widget.js +0 -106
- package/lib/browser/views/preference-tree-widget.js.map +0 -1
- package/lib/browser/views/preference-widget-bindings.d.ts +0 -4
- package/lib/browser/views/preference-widget-bindings.d.ts.map +0 -1
- package/lib/browser/views/preference-widget-bindings.js +0 -91
- package/lib/browser/views/preference-widget-bindings.js.map +0 -1
- package/lib/browser/views/preference-widget.d.ts +0 -38
- package/lib/browser/views/preference-widget.d.ts.map +0 -1
- package/lib/browser/views/preference-widget.js +0 -120
- package/lib/browser/views/preference-widget.js.map +0 -1
- package/lib/browser/workspace-file-preference-provider.d.ts +0 -24
- package/lib/browser/workspace-file-preference-provider.d.ts.map +0 -1
- package/lib/browser/workspace-file-preference-provider.js +0 -103
- package/lib/browser/workspace-file-preference-provider.js.map +0 -1
- package/lib/browser/workspace-preference-provider.d.ts +0 -36
- package/lib/browser/workspace-preference-provider.d.ts.map +0 -1
- package/lib/browser/workspace-preference-provider.js +0 -145
- package/lib/browser/workspace-preference-provider.js.map +0 -1
- package/lib/common/abstract-resource-preference-provider.d.ts +0 -69
- package/lib/common/abstract-resource-preference-provider.d.ts.map +0 -1
- package/lib/common/abstract-resource-preference-provider.js +0 -207
- package/lib/common/abstract-resource-preference-provider.js.map +0 -1
- package/lib/common/abstract-resource-preference-provider.spec.d.ts +0 -2
- package/lib/common/abstract-resource-preference-provider.spec.d.ts.map +0 -1
- package/lib/common/abstract-resource-preference-provider.spec.js +0 -84
- package/lib/common/abstract-resource-preference-provider.spec.js.map +0 -1
- package/lib/common/cli-preferences.d.ts +0 -6
- package/lib/common/cli-preferences.d.ts.map +0 -1
- package/lib/common/cli-preferences.js +0 -21
- package/lib/common/cli-preferences.js.map +0 -1
- package/lib/common/jsonc-editor.d.ts +0 -10
- package/lib/common/jsonc-editor.d.ts.map +0 -1
- package/lib/common/jsonc-editor.js +0 -68
- package/lib/common/jsonc-editor.js.map +0 -1
- package/lib/common/section-preference-provider.d.ts +0 -20
- package/lib/common/section-preference-provider.d.ts.map +0 -1
- package/lib/common/section-preference-provider.js +0 -84
- package/lib/common/section-preference-provider.js.map +0 -1
- package/lib/common/user-configs-preference-provider.d.ts +0 -24
- package/lib/common/user-configs-preference-provider.d.ts.map +0 -1
- package/lib/common/user-configs-preference-provider.js +0 -134
- package/lib/common/user-configs-preference-provider.js.map +0 -1
- package/lib/common/user-preference-provider.d.ts +0 -14
- package/lib/common/user-preference-provider.d.ts.map +0 -1
- package/lib/common/user-preference-provider.js +0 -37
- package/lib/common/user-preference-provider.js.map +0 -1
- package/lib/node/backend-preference-storage.d.ts +0 -34
- package/lib/node/backend-preference-storage.d.ts.map +0 -1
- package/lib/node/backend-preference-storage.js +0 -100
- package/lib/node/backend-preference-storage.js.map +0 -1
- package/lib/node/preference-backend-module.d.ts +0 -4
- package/lib/node/preference-backend-module.d.ts.map +0 -1
- package/lib/node/preference-backend-module.js +0 -41
- package/lib/node/preference-backend-module.js.map +0 -1
- package/lib/node/preference-bindings.d.ts +0 -3
- package/lib/node/preference-bindings.d.ts.map +0 -1
- package/lib/node/preference-bindings.js +0 -33
- package/lib/node/preference-bindings.js.map +0 -1
- package/lib/node/preference-cli-contribution.d.ts +0 -11
- package/lib/node/preference-cli-contribution.d.ts.map +0 -1
- package/lib/node/preference-cli-contribution.js +0 -48
- package/lib/node/preference-cli-contribution.js.map +0 -1
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2021 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-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.JSONCEditor = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
const jsoncparser = require("jsonc-parser");
|
|
21
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
|
-
const core_1 = require("@theia/core");
|
|
23
|
-
let JSONCEditor = class JSONCEditor {
|
|
24
|
-
setValue(model, path, value) {
|
|
25
|
-
const edits = this.getEditOperations(model, path, value);
|
|
26
|
-
return jsoncparser.applyEdits(model, edits);
|
|
27
|
-
}
|
|
28
|
-
getEditOperations(content, path, value) {
|
|
29
|
-
// Everything is already undefined - no need for changes.
|
|
30
|
-
if (!content && value === undefined) {
|
|
31
|
-
return [];
|
|
32
|
-
}
|
|
33
|
-
// Delete the entire document.
|
|
34
|
-
if (!path.length && value === undefined) {
|
|
35
|
-
return [{
|
|
36
|
-
offset: 0,
|
|
37
|
-
length: content.length,
|
|
38
|
-
content: ''
|
|
39
|
-
}];
|
|
40
|
-
}
|
|
41
|
-
const tabSize = this.preferenceService.get('[json].editor.tabSize', 4);
|
|
42
|
-
const insertSpaces = this.preferenceService.get('[json].editor.insertSpaces', true);
|
|
43
|
-
const jsonCOptions = {
|
|
44
|
-
formattingOptions: {
|
|
45
|
-
insertSpaces,
|
|
46
|
-
tabSize,
|
|
47
|
-
eol: this.getEOL()
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
return jsoncparser.modify(content, path, value, jsonCOptions);
|
|
51
|
-
}
|
|
52
|
-
getEOL() {
|
|
53
|
-
const eol = this.preferenceService.get('[json].files.eol');
|
|
54
|
-
if (eol && typeof eol === 'string' && eol !== 'auto') {
|
|
55
|
-
return eol;
|
|
56
|
-
}
|
|
57
|
-
return core_1.isWindows ? '\r\n' : '\n';
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
exports.JSONCEditor = JSONCEditor;
|
|
61
|
-
tslib_1.__decorate([
|
|
62
|
-
(0, inversify_1.inject)(core_1.PreferenceService),
|
|
63
|
-
tslib_1.__metadata("design:type", Object)
|
|
64
|
-
], JSONCEditor.prototype, "preferenceService", void 0);
|
|
65
|
-
exports.JSONCEditor = JSONCEditor = tslib_1.__decorate([
|
|
66
|
-
(0, inversify_1.injectable)()
|
|
67
|
-
], JSONCEditor);
|
|
68
|
-
//# sourceMappingURL=jsonc-editor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsonc-editor.js","sourceRoot":"","sources":["../../src/common/jsonc-editor.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,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,4CAA4C;AAC5C,4DAAkE;AAElE,sCAA2D;AAGpD,IAAM,WAAW,GAAjB,MAAM,WAAW;IAIpB,QAAQ,CAAC,KAAa,EAAE,IAA0B,EAAE,KAAgB;QAChE,MAAM,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,I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W;AAED;IADlB,IAAA,kBAAM,EAAC,wBAAiB,CAAC;;sDAC8B;sBAF/C,WAAW;IADvB,IAAA,sBAAU,GAAE;GACA,WAAW,CA0CvB"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import URI from '@theia/core/lib/common/uri';
|
|
2
|
-
import { AbstractResourcePreferenceProvider } from './abstract-resource-preference-provider';
|
|
3
|
-
import { PreferenceConfigurations } from '@theia/core';
|
|
4
|
-
export declare const SectionPreferenceProviderUri: unique symbol;
|
|
5
|
-
export declare const SectionPreferenceProviderSection: unique symbol;
|
|
6
|
-
/**
|
|
7
|
-
* This class encapsulates the logic of using separate files for some workspace configuration like 'launch.json' or 'tasks.json'.
|
|
8
|
-
* Anything that is not a contributed section will be in the main config file.
|
|
9
|
-
*/
|
|
10
|
-
export declare abstract class SectionPreferenceProvider extends AbstractResourcePreferenceProvider {
|
|
11
|
-
protected readonly uri: URI;
|
|
12
|
-
protected readonly section: string;
|
|
13
|
-
protected readonly preferenceConfigurations: PreferenceConfigurations;
|
|
14
|
-
private _isSection?;
|
|
15
|
-
private get isSection();
|
|
16
|
-
protected getUri(): URI;
|
|
17
|
-
protected parse(content: string): any;
|
|
18
|
-
protected getPath(preferenceName: string): string[] | undefined;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=section-preference-provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"section-preference-provider.d.ts","sourceRoot":"","sources":["../../src/common/section-preference-provider.ts"],"names":[],"mappings":"AAiBA,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAC7C,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,eAAO,MAAM,4BAA4B,eAAyC,CAAC;AACnF,eAAO,MAAM,gCAAgC,eAA6C,CAAC;AAE3F;;;GAGG;AACH,8BACsB,yBAA0B,SAAQ,kCAAkC;IAEtF,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;IAE5B,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEnC,SAAS,CAAC,QAAQ,CAAC,wBAAwB,EAAE,wBAAwB,CAAC;IAEtE,OAAO,CAAC,UAAU,CAAC,CAAU;IAE7B,OAAO,KAAK,SAAS,GAKpB;IAED,SAAS,CAAC,MAAM,IAAI,GAAG;cAIJ,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG;cAgB3B,OAAO,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;CAY3E"}
|
|
@@ -1,84 +0,0 @@
|
|
|
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-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.SectionPreferenceProvider = exports.SectionPreferenceProviderSection = exports.SectionPreferenceProviderUri = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
-
const uri_1 = require("@theia/core/lib/common/uri");
|
|
22
|
-
const abstract_resource_preference_provider_1 = require("./abstract-resource-preference-provider");
|
|
23
|
-
const core_1 = require("@theia/core");
|
|
24
|
-
exports.SectionPreferenceProviderUri = Symbol('SectionPreferenceProviderUri');
|
|
25
|
-
exports.SectionPreferenceProviderSection = Symbol('SectionPreferenceProviderSection');
|
|
26
|
-
/**
|
|
27
|
-
* This class encapsulates the logic of using separate files for some workspace configuration like 'launch.json' or 'tasks.json'.
|
|
28
|
-
* Anything that is not a contributed section will be in the main config file.
|
|
29
|
-
*/
|
|
30
|
-
let SectionPreferenceProvider = class SectionPreferenceProvider extends abstract_resource_preference_provider_1.AbstractResourcePreferenceProvider {
|
|
31
|
-
get isSection() {
|
|
32
|
-
if (typeof this._isSection === 'undefined') {
|
|
33
|
-
this._isSection = this.preferenceConfigurations.isSectionName(this.section);
|
|
34
|
-
}
|
|
35
|
-
return this._isSection;
|
|
36
|
-
}
|
|
37
|
-
getUri() {
|
|
38
|
-
return this.uri;
|
|
39
|
-
}
|
|
40
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
|
-
parse(content) {
|
|
42
|
-
const prefs = super.parse(content);
|
|
43
|
-
if (this.isSection) {
|
|
44
|
-
if (prefs === undefined) {
|
|
45
|
-
return undefined;
|
|
46
|
-
}
|
|
47
|
-
const result = {};
|
|
48
|
-
result[this.section] = { ...prefs };
|
|
49
|
-
return result;
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
return prefs;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
getPath(preferenceName) {
|
|
56
|
-
if (!this.isSection) {
|
|
57
|
-
return super.getPath(preferenceName);
|
|
58
|
-
}
|
|
59
|
-
if (preferenceName === this.section) {
|
|
60
|
-
return [];
|
|
61
|
-
}
|
|
62
|
-
if (preferenceName.startsWith(`${this.section}.`)) {
|
|
63
|
-
return [preferenceName.slice(this.section.length + 1)];
|
|
64
|
-
}
|
|
65
|
-
return undefined;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
exports.SectionPreferenceProvider = SectionPreferenceProvider;
|
|
69
|
-
tslib_1.__decorate([
|
|
70
|
-
(0, inversify_1.inject)(exports.SectionPreferenceProviderUri),
|
|
71
|
-
tslib_1.__metadata("design:type", uri_1.default)
|
|
72
|
-
], SectionPreferenceProvider.prototype, "uri", void 0);
|
|
73
|
-
tslib_1.__decorate([
|
|
74
|
-
(0, inversify_1.inject)(exports.SectionPreferenceProviderSection),
|
|
75
|
-
tslib_1.__metadata("design:type", String)
|
|
76
|
-
], SectionPreferenceProvider.prototype, "section", void 0);
|
|
77
|
-
tslib_1.__decorate([
|
|
78
|
-
(0, inversify_1.inject)(core_1.PreferenceConfigurations),
|
|
79
|
-
tslib_1.__metadata("design:type", core_1.PreferenceConfigurations)
|
|
80
|
-
], SectionPreferenceProvider.prototype, "preferenceConfigurations", void 0);
|
|
81
|
-
exports.SectionPreferenceProvider = SectionPreferenceProvider = tslib_1.__decorate([
|
|
82
|
-
(0, inversify_1.injectable)()
|
|
83
|
-
], SectionPreferenceProvider);
|
|
84
|
-
//# sourceMappingURL=section-preference-provider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"section-preference-provider.js","sourceRoot":"","sources":["../../src/common/section-preference-provider.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,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,mGAA6F;AAC7F,sCAAuD;AAE1C,QAAA,4BAA4B,GAAG,MAAM,CAAC,8BAA8B,CAAC,CAAC;AACtE,QAAA,gCAAgC,GAAG,MAAM,CAAC,kCAAkC,CAAC,CAAC;AAE3F;;;GAGG;AAEI,IAAe,yBAAyB,GAAxC,MAAe,yBAA0B,SAAQ,0EAAkC;IAUtF,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A,kBAAM,EAAC,oCAA4B,CAAC;sCACb,aAAG;sDAAC;AAET;IADlB,IAAA,kBAAM,EAAC,wCAAgC,CAAC;;0DACN;AAEhB;IADlB,IAAA,kBAAM,EAAC,+BAAwB,CAAC;sCACY,+BAAwB;2EAAC;oCANpD,yBAAyB;IAD9C,IAAA,sBAAU,GAAE;GACS,yBAAyB,CAiD9C"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import URI from '@theia/core/lib/common/uri';
|
|
2
|
-
import { UserPreferenceProvider, UserPreferenceProviderFactory } from '../common/user-preference-provider';
|
|
3
|
-
import { PreferenceProviderImpl, PreferenceConfigurations, PreferenceResolveResult } from '@theia/core';
|
|
4
|
-
export declare const UserStorageLocationProvider: unique symbol;
|
|
5
|
-
/**
|
|
6
|
-
* Binds together preference section prefs providers for user-level preferences.
|
|
7
|
-
*/
|
|
8
|
-
export declare class UserConfigsPreferenceProvider extends PreferenceProviderImpl {
|
|
9
|
-
protected readonly providerFactory: UserPreferenceProviderFactory;
|
|
10
|
-
private userStorageLocationProvider;
|
|
11
|
-
protected readonly configurations: PreferenceConfigurations;
|
|
12
|
-
protected readonly providers: Map<string, UserPreferenceProvider>;
|
|
13
|
-
protected init(): void;
|
|
14
|
-
protected doInit(): Promise<void>;
|
|
15
|
-
protected createProviders(userStorageLocation: URI): void;
|
|
16
|
-
getConfigUri(resourceUri?: string, sectionName?: string): URI | undefined;
|
|
17
|
-
resolve<T>(preferenceName: string, resourceUri?: string): PreferenceResolveResult<T>;
|
|
18
|
-
getPreferences(resourceUri?: string): {
|
|
19
|
-
[p: string]: any;
|
|
20
|
-
};
|
|
21
|
-
setPreference(preferenceName: string, value: any, resourceUri?: string): Promise<boolean>;
|
|
22
|
-
protected createProvider(uri: URI, sectionName: string): UserPreferenceProvider;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=user-configs-preference-provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user-configs-preference-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0 @@
|
|
|
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-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.UserConfigsPreferenceProvider = exports.UserStorageLocationProvider = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
21
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
|
-
const user_preference_provider_1 = require("../common/user-preference-provider");
|
|
23
|
-
const core_1 = require("@theia/core");
|
|
24
|
-
exports.UserStorageLocationProvider = Symbol('UserStorageLocationProvider');
|
|
25
|
-
/**
|
|
26
|
-
* Binds together preference section prefs providers for user-level preferences.
|
|
27
|
-
*/
|
|
28
|
-
let UserConfigsPreferenceProvider = class UserConfigsPreferenceProvider extends core_1.PreferenceProviderImpl {
|
|
29
|
-
constructor() {
|
|
30
|
-
super(...arguments);
|
|
31
|
-
this.providers = new Map();
|
|
32
|
-
}
|
|
33
|
-
init() {
|
|
34
|
-
this.doInit();
|
|
35
|
-
}
|
|
36
|
-
async doInit() {
|
|
37
|
-
const userStorageUri = await this.userStorageLocationProvider();
|
|
38
|
-
this.createProviders(userStorageUri);
|
|
39
|
-
const readyPromises = [];
|
|
40
|
-
for (const provider of this.providers.values()) {
|
|
41
|
-
readyPromises.push(provider.ready.catch(e => console.error(e)));
|
|
42
|
-
}
|
|
43
|
-
Promise.all(readyPromises).then(() => this._ready.resolve());
|
|
44
|
-
}
|
|
45
|
-
createProviders(userStorageLocation) {
|
|
46
|
-
for (const configName of [...this.configurations.getSectionNames(), this.configurations.getConfigName()]) {
|
|
47
|
-
const sectionUri = userStorageLocation.resolve(configName + '.json');
|
|
48
|
-
const sectionKey = sectionUri.toString();
|
|
49
|
-
if (!this.providers.has(sectionKey)) {
|
|
50
|
-
const provider = this.createProvider(sectionUri, configName);
|
|
51
|
-
this.providers.set(sectionKey, provider);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
getConfigUri(resourceUri, sectionName = this.configurations.getConfigName()) {
|
|
56
|
-
for (const provider of this.providers.values()) {
|
|
57
|
-
const configUri = provider.getConfigUri(resourceUri);
|
|
58
|
-
if (configUri && this.configurations.getName(configUri) === sectionName) {
|
|
59
|
-
return configUri;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return undefined;
|
|
63
|
-
}
|
|
64
|
-
resolve(preferenceName, resourceUri) {
|
|
65
|
-
const result = {};
|
|
66
|
-
for (const provider of this.providers.values()) {
|
|
67
|
-
const { value, configUri } = provider.resolve(preferenceName, resourceUri);
|
|
68
|
-
if (configUri && value !== undefined) {
|
|
69
|
-
result.configUri = configUri;
|
|
70
|
-
result.value = core_1.PreferenceUtils.merge(result.value, value);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return result;
|
|
74
|
-
}
|
|
75
|
-
getPreferences(resourceUri) {
|
|
76
|
-
let result = {};
|
|
77
|
-
for (const provider of this.providers.values()) {
|
|
78
|
-
const preferences = provider.getPreferences();
|
|
79
|
-
result = core_1.PreferenceUtils.merge(result, preferences);
|
|
80
|
-
}
|
|
81
|
-
return result;
|
|
82
|
-
}
|
|
83
|
-
async setPreference(preferenceName, value, resourceUri) {
|
|
84
|
-
const sectionName = preferenceName.split('.', 1)[0];
|
|
85
|
-
const defaultConfigName = this.configurations.getConfigName();
|
|
86
|
-
const configName = this.configurations.isSectionName(sectionName) ? sectionName : defaultConfigName;
|
|
87
|
-
const setWithConfigName = async (name) => {
|
|
88
|
-
for (const provider of this.providers.values()) {
|
|
89
|
-
if (this.configurations.getName(provider.getConfigUri()) === name) {
|
|
90
|
-
if (await provider.setPreference(preferenceName, value, resourceUri)) {
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return false;
|
|
96
|
-
};
|
|
97
|
-
if (await setWithConfigName(configName)) { // Try in the section we believe it belongs in.
|
|
98
|
-
return true;
|
|
99
|
-
}
|
|
100
|
-
else if (configName !== defaultConfigName) { // Fall back to `settings.json` if that fails.
|
|
101
|
-
return setWithConfigName(defaultConfigName);
|
|
102
|
-
}
|
|
103
|
-
return false;
|
|
104
|
-
}
|
|
105
|
-
createProvider(uri, sectionName) {
|
|
106
|
-
const provider = this.providerFactory(uri, sectionName);
|
|
107
|
-
this.toDispose.push(provider);
|
|
108
|
-
this.toDispose.push(provider.onDidPreferencesChanged(change => this.onDidPreferencesChangedEmitter.fire(change)));
|
|
109
|
-
return provider;
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
exports.UserConfigsPreferenceProvider = UserConfigsPreferenceProvider;
|
|
113
|
-
tslib_1.__decorate([
|
|
114
|
-
(0, inversify_1.inject)(user_preference_provider_1.UserPreferenceProviderFactory),
|
|
115
|
-
tslib_1.__metadata("design:type", Function)
|
|
116
|
-
], UserConfigsPreferenceProvider.prototype, "providerFactory", void 0);
|
|
117
|
-
tslib_1.__decorate([
|
|
118
|
-
(0, inversify_1.inject)(exports.UserStorageLocationProvider),
|
|
119
|
-
tslib_1.__metadata("design:type", Function)
|
|
120
|
-
], UserConfigsPreferenceProvider.prototype, "userStorageLocationProvider", void 0);
|
|
121
|
-
tslib_1.__decorate([
|
|
122
|
-
(0, inversify_1.inject)(core_1.PreferenceConfigurations),
|
|
123
|
-
tslib_1.__metadata("design:type", core_1.PreferenceConfigurations)
|
|
124
|
-
], UserConfigsPreferenceProvider.prototype, "configurations", void 0);
|
|
125
|
-
tslib_1.__decorate([
|
|
126
|
-
(0, inversify_1.postConstruct)(),
|
|
127
|
-
tslib_1.__metadata("design:type", Function),
|
|
128
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
129
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
130
|
-
], UserConfigsPreferenceProvider.prototype, "init", null);
|
|
131
|
-
exports.UserConfigsPreferenceProvider = UserConfigsPreferenceProvider = tslib_1.__decorate([
|
|
132
|
-
(0, inversify_1.injectable)()
|
|
133
|
-
], UserConfigsPreferenceProvider);
|
|
134
|
-
//# sourceMappingURL=user-configs-preference-provider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user-configs-preference-provider.js","sourceRoot":"","sources":["../../src/common/user-configs-preference-provider.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,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,uDAAuD;AAEvD,4DAAiF;AAEjF,iFAA2G;AAC3G,sCAAyH;AAE5G,QAAA,2BAA2B,GAAG,MAAM,CAAC,6BAA6B,CAAC,CAAC;AAEjF;;GAEG;AAEI,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,6BAAsB;IAAlE;;QAWgB,cAAS,GAAG,IAAI,GAAG,EAAkC,CAAC;IA0F7E,CAAC;IAvFa,IAAI;QACV,IAAI,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;IAES,KAAK,CAAC,MAAM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,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAClH,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ,CAAA;AArGY,sEAA6B;AAGnB;IADlB,IAAA,kBAAM,EAAC,wDAA6B,CAAC;;sEAC4B;AAG1D;IADP,IAAA,kBAAM,EAAC,mCAA2B,CAAC;;kFACoB;AAGrC;IADlB,IAAA,kBAAM,EAAC,+BAAwB,CAAC;sCACE,+BAAwB;qEAAC;AAKlD;IADT,IAAA,yBAAa,GAAE;;;;yDAGf;wCAhBQ,6BAA6B;IADzC,IAAA,sBAAU,GAAE;GACA,6BAA6B,CAqGzC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import URI from '@theia/core/lib/common/uri';
|
|
2
|
-
import { SectionPreferenceProvider } from './section-preference-provider';
|
|
3
|
-
import { PreferenceScope } from '@theia/core';
|
|
4
|
-
export declare const UserPreferenceProviderFactory: unique symbol;
|
|
5
|
-
export interface UserPreferenceProviderFactory {
|
|
6
|
-
(uri: URI, section: string): UserPreferenceProvider;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* A @SectionPreferenceProvider that targets the user-level settings
|
|
10
|
-
*/
|
|
11
|
-
export declare class UserPreferenceProvider extends SectionPreferenceProvider {
|
|
12
|
-
getScope(): PreferenceScope;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=user-preference-provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user-preference-provider.d.ts","sourceRoot":"","sources":["../../src/common/user-preference-provider.ts"],"names":[],"mappings":"AAiBA,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,eAAO,MAAM,6BAA6B,eAA0C,CAAC;AACrF,MAAM,WAAW,6BAA6B;IAC1C,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,sBAAsB,CAAC;CACvD;AAED;;GAEG;AACH,qBACa,sBAAuB,SAAQ,yBAAyB;IACjE,QAAQ,IAAI,eAAe;CAG9B"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2018 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-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.UserPreferenceProvider = exports.UserPreferenceProviderFactory = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
-
const section_preference_provider_1 = require("./section-preference-provider");
|
|
22
|
-
const core_1 = require("@theia/core");
|
|
23
|
-
exports.UserPreferenceProviderFactory = Symbol('UserPreferenceProviderFactory');
|
|
24
|
-
;
|
|
25
|
-
/**
|
|
26
|
-
* A @SectionPreferenceProvider that targets the user-level settings
|
|
27
|
-
*/
|
|
28
|
-
let UserPreferenceProvider = class UserPreferenceProvider extends section_preference_provider_1.SectionPreferenceProvider {
|
|
29
|
-
getScope() {
|
|
30
|
-
return core_1.PreferenceScope.User;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
exports.UserPreferenceProvider = UserPreferenceProvider;
|
|
34
|
-
exports.UserPreferenceProvider = UserPreferenceProvider = tslib_1.__decorate([
|
|
35
|
-
(0, inversify_1.injectable)()
|
|
36
|
-
], UserPreferenceProvider);
|
|
37
|
-
//# sourceMappingURL=user-preference-provider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user-preference-provider.js","sourceRoot":"","sources":["../../src/common/user-preference-provider.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,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,4DAA0D;AAE1D,+EAA0E;AAC1E,sCAA8C;AAEjC,QAAA,6BAA6B,GAAG,MAAM,CAAC,+BAA+B,CAAC,CAAC;AAGpF,CAAC;AAEF;;GAEG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,uDAAyB;IACjE,QAAQ;QACJ,OAAO,sBAAe,CAAC,IAAI,CAAC;IAChC,CAAC;CACJ,CAAA;AAJY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CAIlC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
|
-
import { Listener, ListenerList, URI } from '@theia/core';
|
|
3
|
-
import { JSONValue } from '@theia/core/shared/@lumino/coreutils';
|
|
4
|
-
import { FileContentStatus, PreferenceStorage } from '../common/abstract-resource-preference-provider';
|
|
5
|
-
import { EncodingService } from '@theia/core/lib/common/encoding-service';
|
|
6
|
-
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
7
|
-
import { JSONCEditor } from '../common/jsonc-editor';
|
|
8
|
-
import { DiskFileSystemProvider } from '@theia/filesystem/lib/node/disk-file-system-provider';
|
|
9
|
-
interface WriteOperation {
|
|
10
|
-
key: string;
|
|
11
|
-
path: string[];
|
|
12
|
-
value: JSONValue;
|
|
13
|
-
}
|
|
14
|
-
export declare class BackendPreferenceStorage implements PreferenceStorage {
|
|
15
|
-
protected readonly fileSystem: DiskFileSystemProvider;
|
|
16
|
-
protected readonly uri: URI;
|
|
17
|
-
protected readonly encodingService: EncodingService;
|
|
18
|
-
protected readonly jsonEditor: JSONCEditor;
|
|
19
|
-
protected pendingWrites: WriteOperation[];
|
|
20
|
-
protected writeDeferred: Deferred<boolean>;
|
|
21
|
-
protected writeFile: import("lodash").DebouncedFunc<() => void>;
|
|
22
|
-
protected currentContent: string | undefined;
|
|
23
|
-
protected encoding: string;
|
|
24
|
-
constructor(fileSystem: DiskFileSystemProvider, uri: URI, encodingService: EncodingService, jsonEditor: JSONCEditor);
|
|
25
|
-
writeValue(key: string, path: string[], value: JSONValue): Promise<boolean>;
|
|
26
|
-
waitForWrite(): Promise<boolean>;
|
|
27
|
-
doWrite(): Promise<void>;
|
|
28
|
-
protected readonly onDidChangeFileContentListeners: ListenerList<FileContentStatus, Promise<boolean>>;
|
|
29
|
-
onDidChangeFileContent: Listener.Registration<FileContentStatus, Promise<boolean>>;
|
|
30
|
-
read(): Promise<string>;
|
|
31
|
-
dispose(): void;
|
|
32
|
-
}
|
|
33
|
-
export {};
|
|
34
|
-
//# sourceMappingURL=backend-preference-storage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"backend-preference-storage.d.ts","sourceRoot":"","sources":["../../src/node/backend-preference-storage.ts"],"names":[],"mappings":";AAgBA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AACvG,OAAO,EAAE,eAAe,EAAE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CAAC,MAAM,CAAC;IAO7B,OAAO,IAAI,IAAI;CAGlB"}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2025 STMicroelectronics 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-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.BackendPreferenceStorage = void 0;
|
|
19
|
-
const core_1 = require("@theia/core");
|
|
20
|
-
const buffer_1 = require("@theia/core/lib/common/buffer");
|
|
21
|
-
const promise_util_1 = require("@theia/core/lib/common/promise-util");
|
|
22
|
-
const debounce = require("@theia/core/shared/lodash.debounce");
|
|
23
|
-
const encodings_1 = require("@theia/core/lib/common/encodings");
|
|
24
|
-
class BackendPreferenceStorage {
|
|
25
|
-
constructor(fileSystem, uri, encodingService, jsonEditor) {
|
|
26
|
-
this.fileSystem = fileSystem;
|
|
27
|
-
this.uri = uri;
|
|
28
|
-
this.encodingService = encodingService;
|
|
29
|
-
this.jsonEditor = jsonEditor;
|
|
30
|
-
this.pendingWrites = [];
|
|
31
|
-
this.writeDeferred = new promise_util_1.Deferred();
|
|
32
|
-
this.writeFile = debounce(() => {
|
|
33
|
-
this.doWrite();
|
|
34
|
-
}, 10);
|
|
35
|
-
this.currentContent = undefined;
|
|
36
|
-
this.encoding = encodings_1.UTF8;
|
|
37
|
-
this.onDidChangeFileContentListeners = new core_1.ListenerList();
|
|
38
|
-
this.onDidChangeFileContent = this.onDidChangeFileContentListeners.registration;
|
|
39
|
-
this.fileSystem.watch(uri, { excludes: [], recursive: false });
|
|
40
|
-
this.fileSystem.onDidChangeFile(events => {
|
|
41
|
-
for (const e of events) {
|
|
42
|
-
if (e.resource.isEqual(uri)) {
|
|
43
|
-
this.read().then(content => this.onDidChangeFileContentListeners.invoke({ content, fileOK: true }, () => { }))
|
|
44
|
-
.catch(() => this.onDidChangeFileContentListeners.invoke({ content: '', fileOK: false }, () => { }));
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
writeValue(key, path, value) {
|
|
50
|
-
this.pendingWrites.push({
|
|
51
|
-
key, path, value
|
|
52
|
-
});
|
|
53
|
-
return this.waitForWrite();
|
|
54
|
-
}
|
|
55
|
-
waitForWrite() {
|
|
56
|
-
const result = this.writeDeferred.promise;
|
|
57
|
-
this.writeFile();
|
|
58
|
-
return result;
|
|
59
|
-
}
|
|
60
|
-
async doWrite() {
|
|
61
|
-
try {
|
|
62
|
-
if (this.currentContent === undefined) {
|
|
63
|
-
await this.read();
|
|
64
|
-
}
|
|
65
|
-
let newContent = this.currentContent || '';
|
|
66
|
-
for (const op of this.pendingWrites) {
|
|
67
|
-
newContent = this.jsonEditor.setValue(newContent, op.path, op.value);
|
|
68
|
-
}
|
|
69
|
-
await this.fileSystem.writeFile(this.uri, this.encodingService.encode(newContent, {
|
|
70
|
-
encoding: this.encoding,
|
|
71
|
-
hasBOM: false
|
|
72
|
-
}).buffer, {
|
|
73
|
-
create: true,
|
|
74
|
-
overwrite: true
|
|
75
|
-
});
|
|
76
|
-
this.currentContent = newContent;
|
|
77
|
-
this.pendingWrites = [];
|
|
78
|
-
await core_1.Listener.awaitAll({ content: newContent, fileOK: true }, this.onDidChangeFileContentListeners);
|
|
79
|
-
this.writeDeferred.resolve(true);
|
|
80
|
-
}
|
|
81
|
-
catch (e) {
|
|
82
|
-
this.currentContent = undefined;
|
|
83
|
-
console.error(e);
|
|
84
|
-
this.writeDeferred.resolve(false);
|
|
85
|
-
}
|
|
86
|
-
finally {
|
|
87
|
-
this.writeDeferred = new promise_util_1.Deferred();
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
async read() {
|
|
91
|
-
const contents = buffer_1.BinaryBuffer.wrap(await this.fileSystem.readFile(this.uri));
|
|
92
|
-
this.encoding = (await this.encodingService.detectEncoding(contents)).encoding || this.encoding;
|
|
93
|
-
this.currentContent = this.encodingService.decode(contents, this.encoding);
|
|
94
|
-
return this.currentContent;
|
|
95
|
-
}
|
|
96
|
-
dispose() {
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
exports.BackendPreferenceStorage = BackendPreferenceStorage;
|
|
100
|
-
//# sourceMappingURL=backend-preference-storage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"backend-preference-storage.js","sourceRoot":"","sources":["../../src/node/backend-preference-storage.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,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,sCAA0D;AAI1D,0DAA6D;AAC7D,sEAA+D;AAC/D,+DAAgE;AAGhE,gEAAwD;AAQxD,MAAa,wBAAwB;IAWjC,YACuB,UAAkC,EAClC,GAAQ,EACR,eAAgC,EAChC,UAAuB;QAHvB,eAAU,GAAV,UAAU,CAAwB;QAClC,QAAG,GAAH,GAAG,CAAK;QACR,oBAAe,GAAf,eAAe,CAAiB;QAChC,eAAU,GAAV,UAAU,CAAa;QAbpC,kBAAa,GAAqB,EAAE,CA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AC;YAChC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACjB,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACtC,CAAC;gBAAS,CAAC;YACP,IAAI,CAAC,aAAa,GAAG,IAAI,uBAAQ,EAAE,CAAC;QACxC,CAAC;IACL,CAAC;IAKD,KAAK,CAAC,IAAI;QACN,MAAM,QAAQ,GAAG,qBAAY,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7E,IAAI,CAAC,QAAQ,GAAG,CAAC,MAAM,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC;QAChG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3E,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,OAAO;IACP,CAAC;CAEJ;AAnFD,4DAmFC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preference-backend-module.d.ts","sourceRoot":"","sources":["../../src/node/preference-backend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAiB/D,wBAeG"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2024 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-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
19
|
-
const cli_1 = require("@theia/core/lib/node/cli");
|
|
20
|
-
const preference_cli_contribution_1 = require("./preference-cli-contribution");
|
|
21
|
-
const connection_container_module_1 = require("@theia/core/lib/node/messaging/connection-container-module");
|
|
22
|
-
const cli_preferences_1 = require("../common/cli-preferences");
|
|
23
|
-
const preference_bindings_1 = require("./preference-bindings");
|
|
24
|
-
const abstract_resource_preference_provider_1 = require("../common/abstract-resource-preference-provider");
|
|
25
|
-
const backend_preference_storage_1 = require("./backend-preference-storage");
|
|
26
|
-
const jsonc_editor_1 = require("../common/jsonc-editor");
|
|
27
|
-
const encoding_service_1 = require("@theia/core/lib/common/encoding-service");
|
|
28
|
-
const disk_file_system_provider_1 = require("@theia/filesystem/lib/node/disk-file-system-provider");
|
|
29
|
-
const preferencesConnectionModule = connection_container_module_1.ConnectionContainerModule.create(({ bind, bindBackendService }) => {
|
|
30
|
-
bindBackendService(cli_preferences_1.CliPreferencesPath, cli_preferences_1.CliPreferences);
|
|
31
|
-
});
|
|
32
|
-
exports.default = new inversify_1.ContainerModule(bind => {
|
|
33
|
-
bind(preference_cli_contribution_1.PreferenceCliContribution).toSelf().inSingletonScope();
|
|
34
|
-
bind(cli_preferences_1.CliPreferences).toService(preference_cli_contribution_1.PreferenceCliContribution);
|
|
35
|
-
bind(cli_1.CliContribution).toService(preference_cli_contribution_1.PreferenceCliContribution);
|
|
36
|
-
bind(jsonc_editor_1.JSONCEditor).toSelf().inSingletonScope();
|
|
37
|
-
bind(abstract_resource_preference_provider_1.PreferenceStorageFactory).toFactory(({ container }) => (uri, scope) => new backend_preference_storage_1.BackendPreferenceStorage(container.get(disk_file_system_provider_1.DiskFileSystemProvider), uri, container.get(encoding_service_1.EncodingService), container.get(jsonc_editor_1.JSONCEditor)));
|
|
38
|
-
bind(connection_container_module_1.ConnectionContainerModule).toConstantValue(preferencesConnectionModule);
|
|
39
|
-
(0, preference_bindings_1.bindPreferenceProviders)(bind);
|
|
40
|
-
});
|
|
41
|
-
//# sourceMappingURL=preference-backend-module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preference-backend-module.js","sourceRoot":"","sources":["../../src/node/preference-backend-module.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,4DAA+D;AAC/D,kDAA2D;AAC3D,+EAA0E;AAC1E,4GAAuG;AACvG,+DAA+E;AAC/E,+DAAgE;AAChE,2GAA2F;AAE3F,6EAAwE;AACxE,yDAAqD;AACrD,8EAA0E;AAC1E,oGAA8F;AAE9F,MAAM,2BAA2B,GAAG,uDAAyB,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE;IAClG,kBAAkB,CAAC,oCAAkB,EAAE,gCAAc,CAAC,CAAC;AAC3D,CAAC,CAAC,CAAC;AAEH,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,uDAAyB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC5D,IAAI,CAAC,gCAAc,CAAC,CAAC,SAAS,CAAC,uDAAyB,CAAC,CAAC;IAC1D,IAAI,CAAC,qBAAe,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