@theia/preferences 1.67.0-next.56 → 1.67.0-next.59
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/folder-preference-provider.d.ts +23 -0
- package/lib/browser/folder-preference-provider.d.ts.map +1 -0
- package/lib/browser/folder-preference-provider.js +57 -0
- package/lib/browser/folder-preference-provider.js.map +1 -0
- package/lib/browser/folders-preferences-provider.d.ts +27 -0
- package/lib/browser/folders-preferences-provider.d.ts.map +1 -0
- package/lib/browser/folders-preferences-provider.js +237 -0
- package/lib/browser/folders-preferences-provider.js.map +1 -0
- package/lib/browser/frontend-preference-storage.d.ts +20 -0
- package/lib/browser/frontend-preference-storage.d.ts.map +1 -0
- package/lib/browser/frontend-preference-storage.js +63 -0
- package/lib/browser/frontend-preference-storage.js.map +1 -0
- package/lib/browser/index.d.ts +5 -0
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/browser/index.js +23 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/monaco-jsonc-editor.d.ts +10 -0
- package/lib/browser/monaco-jsonc-editor.d.ts.map +1 -0
- package/lib/browser/monaco-jsonc-editor.js +73 -0
- package/lib/browser/monaco-jsonc-editor.js.map +1 -0
- package/lib/browser/package.spec.d.ts +1 -0
- package/lib/browser/package.spec.d.ts.map +1 -0
- package/lib/browser/package.spec.js +26 -0
- package/lib/browser/package.spec.js.map +1 -0
- package/lib/browser/preference-bindings.d.ts +4 -0
- package/lib/browser/preference-bindings.d.ts.map +1 -0
- package/lib/browser/preference-bindings.js +49 -0
- package/lib/browser/preference-bindings.js.map +1 -0
- package/lib/browser/preference-frontend-contribution.d.ts +9 -0
- package/lib/browser/preference-frontend-contribution.d.ts.map +1 -0
- package/lib/browser/preference-frontend-contribution.js +45 -0
- package/lib/browser/preference-frontend-contribution.js.map +1 -0
- package/lib/browser/preference-frontend-module.d.ts +7 -0
- package/lib/browser/preference-frontend-module.d.ts.map +1 -0
- package/lib/browser/preference-frontend-module.js +67 -0
- package/lib/browser/preference-frontend-module.js.map +1 -0
- package/lib/browser/preference-open-handler.d.ts +10 -0
- package/lib/browser/preference-open-handler.d.ts.map +1 -0
- package/lib/browser/preference-open-handler.js +57 -0
- package/lib/browser/preference-open-handler.js.map +1 -0
- package/lib/browser/preference-transaction-manager.d.ts +98 -0
- package/lib/browser/preference-transaction-manager.d.ts.map +1 -0
- package/lib/browser/preference-transaction-manager.js +279 -0
- package/lib/browser/preference-transaction-manager.js.map +1 -0
- package/lib/browser/preference-tree-model.d.ts +60 -0
- package/lib/browser/preference-tree-model.d.ts.map +1 -0
- package/lib/browser/preference-tree-model.js +247 -0
- package/lib/browser/preference-tree-model.js.map +1 -0
- package/lib/browser/preferences-contribution.d.ts +35 -0
- package/lib/browser/preferences-contribution.d.ts.map +1 -0
- package/lib/browser/preferences-contribution.js +263 -0
- package/lib/browser/preferences-contribution.js.map +1 -0
- package/lib/browser/preferences-json-schema-contribution.d.ts +17 -0
- package/lib/browser/preferences-json-schema-contribution.d.ts.map +1 -0
- package/lib/browser/preferences-json-schema-contribution.js +84 -0
- package/lib/browser/preferences-json-schema-contribution.js.map +1 -0
- package/lib/browser/preferences-monaco-contribution.d.ts +2 -0
- package/lib/browser/preferences-monaco-contribution.d.ts.map +1 -0
- package/lib/browser/preferences-monaco-contribution.js +28 -0
- package/lib/browser/preferences-monaco-contribution.js.map +1 -0
- package/lib/browser/util/preference-layout.d.ts +23 -0
- package/lib/browser/util/preference-layout.d.ts.map +1 -0
- package/lib/browser/util/preference-layout.js +441 -0
- package/lib/browser/util/preference-layout.js.map +1 -0
- package/lib/browser/util/preference-scope-command-manager.d.ts +18 -0
- package/lib/browser/util/preference-scope-command-manager.d.ts.map +1 -0
- package/lib/browser/util/preference-scope-command-manager.js +80 -0
- package/lib/browser/util/preference-scope-command-manager.js.map +1 -0
- package/lib/browser/util/preference-tree-generator.d.ts +48 -0
- package/lib/browser/util/preference-tree-generator.d.ts.map +1 -0
- package/lib/browser/util/preference-tree-generator.js +277 -0
- package/lib/browser/util/preference-tree-generator.js.map +1 -0
- package/lib/browser/util/preference-tree-label-provider.d.ts +12 -0
- package/lib/browser/util/preference-tree-label-provider.d.ts.map +1 -0
- package/lib/browser/util/preference-tree-label-provider.js +74 -0
- package/lib/browser/util/preference-tree-label-provider.js.map +1 -0
- package/lib/browser/util/preference-tree-label-provider.spec.d.ts +2 -0
- package/lib/browser/util/preference-tree-label-provider.spec.d.ts.map +1 -0
- package/lib/browser/util/preference-tree-label-provider.spec.js +90 -0
- package/lib/browser/util/preference-tree-label-provider.spec.js.map +1 -0
- package/lib/browser/util/preference-types.d.ts +69 -0
- package/lib/browser/util/preference-types.d.ts.map +1 -0
- package/lib/browser/util/preference-types.js +133 -0
- package/lib/browser/util/preference-types.js.map +1 -0
- package/lib/browser/views/components/preference-array-input.d.ts +29 -0
- package/lib/browser/views/components/preference-array-input.d.ts.map +1 -0
- package/lib/browser/views/components/preference-array-input.js +176 -0
- package/lib/browser/views/components/preference-array-input.js.map +1 -0
- package/lib/browser/views/components/preference-boolean-input.d.ts +18 -0
- package/lib/browser/views/components/preference-boolean-input.d.ts.map +1 -0
- package/lib/browser/views/components/preference-boolean-input.js +75 -0
- package/lib/browser/views/components/preference-boolean-input.js.map +1 -0
- package/lib/browser/views/components/preference-file-input.d.ts +30 -0
- package/lib/browser/views/components/preference-file-input.d.ts.map +1 -0
- package/lib/browser/views/components/preference-file-input.js +103 -0
- package/lib/browser/views/components/preference-file-input.js.map +1 -0
- package/lib/browser/views/components/preference-json-input.d.ts +20 -0
- package/lib/browser/views/components/preference-json-input.d.ts.map +1 -0
- package/lib/browser/views/components/preference-json-input.js +86 -0
- package/lib/browser/views/components/preference-json-input.js.map +1 -0
- package/lib/browser/views/components/preference-markdown-renderer.d.ts +15 -0
- package/lib/browser/views/components/preference-markdown-renderer.d.ts.map +1 -0
- package/lib/browser/views/components/preference-markdown-renderer.js +86 -0
- package/lib/browser/views/components/preference-markdown-renderer.js.map +1 -0
- package/lib/browser/views/components/preference-node-renderer-creator.d.ts +49 -0
- package/lib/browser/views/components/preference-node-renderer-creator.d.ts.map +1 -0
- package/lib/browser/views/components/preference-node-renderer-creator.js +122 -0
- package/lib/browser/views/components/preference-node-renderer-creator.js.map +1 -0
- package/lib/browser/views/components/preference-node-renderer.d.ts +118 -0
- package/lib/browser/views/components/preference-node-renderer.d.ts.map +1 -0
- package/lib/browser/views/components/preference-node-renderer.js +442 -0
- package/lib/browser/views/components/preference-node-renderer.js.map +1 -0
- package/lib/browser/views/components/preference-null-input.d.ts +16 -0
- package/lib/browser/views/components/preference-null-input.d.ts.map +1 -0
- package/lib/browser/views/components/preference-null-input.js +59 -0
- package/lib/browser/views/components/preference-null-input.js.map +1 -0
- package/lib/browser/views/components/preference-number-input.d.ts +35 -0
- package/lib/browser/views/components/preference-number-input.d.ts.map +1 -0
- package/lib/browser/views/components/preference-number-input.js +174 -0
- package/lib/browser/views/components/preference-number-input.js.map +1 -0
- package/lib/browser/views/components/preference-select-input.d.ts +29 -0
- package/lib/browser/views/components/preference-select-input.d.ts.map +1 -0
- package/lib/browser/views/components/preference-select-input.js +131 -0
- package/lib/browser/views/components/preference-select-input.js.map +1 -0
- package/lib/browser/views/components/preference-string-input.d.ts +18 -0
- package/lib/browser/views/components/preference-string-input.d.ts.map +1 -0
- package/lib/browser/views/components/preference-string-input.js +85 -0
- package/lib/browser/views/components/preference-string-input.js.map +1 -0
- package/lib/browser/views/preference-editor-widget.d.ts +75 -0
- package/lib/browser/views/preference-editor-widget.d.ts.map +1 -0
- package/lib/browser/views/preference-editor-widget.js +391 -0
- package/lib/browser/views/preference-editor-widget.js.map +1 -0
- package/lib/browser/views/preference-scope-tabbar-widget.d.ts +55 -0
- package/lib/browser/views/preference-scope-tabbar-widget.d.ts.map +1 -0
- package/lib/browser/views/preference-scope-tabbar-widget.js +337 -0
- package/lib/browser/views/preference-scope-tabbar-widget.js.map +1 -0
- package/lib/browser/views/preference-searchbar-widget.d.ts +54 -0
- package/lib/browser/views/preference-searchbar-widget.d.ts.map +1 -0
- package/lib/browser/views/preference-searchbar-widget.js +163 -0
- package/lib/browser/views/preference-searchbar-widget.js.map +1 -0
- package/lib/browser/views/preference-tree-widget.d.ts +20 -0
- package/lib/browser/views/preference-tree-widget.d.ts.map +1 -0
- package/lib/browser/views/preference-tree-widget.js +106 -0
- package/lib/browser/views/preference-tree-widget.js.map +1 -0
- package/lib/browser/views/preference-widget-bindings.d.ts +4 -0
- package/lib/browser/views/preference-widget-bindings.d.ts.map +1 -0
- package/lib/browser/views/preference-widget-bindings.js +91 -0
- package/lib/browser/views/preference-widget-bindings.js.map +1 -0
- package/lib/browser/views/preference-widget.d.ts +38 -0
- package/lib/browser/views/preference-widget.d.ts.map +1 -0
- package/lib/browser/views/preference-widget.js +120 -0
- package/lib/browser/views/preference-widget.js.map +1 -0
- package/lib/browser/workspace-file-preference-provider.d.ts +24 -0
- package/lib/browser/workspace-file-preference-provider.d.ts.map +1 -0
- package/lib/browser/workspace-file-preference-provider.js +103 -0
- package/lib/browser/workspace-file-preference-provider.js.map +1 -0
- package/lib/browser/workspace-preference-provider.d.ts +36 -0
- package/lib/browser/workspace-preference-provider.d.ts.map +1 -0
- package/lib/browser/workspace-preference-provider.js +147 -0
- package/lib/browser/workspace-preference-provider.js.map +1 -0
- package/lib/common/abstract-resource-preference-provider.d.ts +69 -0
- package/lib/common/abstract-resource-preference-provider.d.ts.map +1 -0
- package/lib/common/abstract-resource-preference-provider.js +207 -0
- package/lib/common/abstract-resource-preference-provider.js.map +1 -0
- package/lib/common/abstract-resource-preference-provider.spec.d.ts +2 -0
- package/lib/common/abstract-resource-preference-provider.spec.d.ts.map +1 -0
- package/lib/common/abstract-resource-preference-provider.spec.js +84 -0
- package/lib/common/abstract-resource-preference-provider.spec.js.map +1 -0
- package/lib/common/cli-preferences.d.ts +6 -0
- package/lib/common/cli-preferences.d.ts.map +1 -0
- package/lib/common/cli-preferences.js +21 -0
- package/lib/common/cli-preferences.js.map +1 -0
- package/lib/common/jsonc-editor.d.ts +10 -0
- package/lib/common/jsonc-editor.d.ts.map +1 -0
- package/lib/common/jsonc-editor.js +68 -0
- package/lib/common/jsonc-editor.js.map +1 -0
- package/lib/common/section-preference-provider.d.ts +20 -0
- package/lib/common/section-preference-provider.d.ts.map +1 -0
- package/lib/common/section-preference-provider.js +84 -0
- package/lib/common/section-preference-provider.js.map +1 -0
- package/lib/common/user-configs-preference-provider.d.ts +24 -0
- package/lib/common/user-configs-preference-provider.d.ts.map +1 -0
- package/lib/common/user-configs-preference-provider.js +134 -0
- package/lib/common/user-configs-preference-provider.js.map +1 -0
- package/lib/common/user-preference-provider.d.ts +14 -0
- package/lib/common/user-preference-provider.d.ts.map +1 -0
- package/lib/common/user-preference-provider.js +37 -0
- package/lib/common/user-preference-provider.js.map +1 -0
- package/lib/node/backend-preference-storage.d.ts +34 -0
- package/lib/node/backend-preference-storage.d.ts.map +1 -0
- package/lib/node/backend-preference-storage.js +100 -0
- package/lib/node/backend-preference-storage.js.map +1 -0
- package/lib/node/preference-backend-module.d.ts +4 -0
- package/lib/node/preference-backend-module.d.ts.map +1 -0
- package/lib/node/preference-backend-module.js +41 -0
- package/lib/node/preference-backend-module.js.map +1 -0
- package/lib/node/preference-bindings.d.ts +3 -0
- package/lib/node/preference-bindings.d.ts.map +1 -0
- package/lib/node/preference-bindings.js +33 -0
- package/lib/node/preference-bindings.js.map +1 -0
- package/lib/node/preference-cli-contribution.d.ts +11 -0
- package/lib/node/preference-cli-contribution.d.ts.map +1 -0
- package/lib/node/preference-cli-contribution.js +48 -0
- package/lib/node/preference-cli-contribution.js.map +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2020 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.PreferenceTreeGenerator = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
+
const core_1 = require("@theia/core");
|
|
23
|
+
const debounce = require("@theia/core/shared/lodash.debounce");
|
|
24
|
+
const preference_types_1 = require("./preference-types");
|
|
25
|
+
const preference_layout_1 = require("./preference-layout");
|
|
26
|
+
const preference_tree_label_provider_1 = require("./preference-tree-label-provider");
|
|
27
|
+
let PreferenceTreeGenerator = class PreferenceTreeGenerator {
|
|
28
|
+
constructor() {
|
|
29
|
+
this._idCache = new Map();
|
|
30
|
+
this.onSchemaChangedEmitter = new core_1.Emitter();
|
|
31
|
+
this.onSchemaChanged = this.onSchemaChangedEmitter.event;
|
|
32
|
+
this.defaultTopLevelCategory = 'extensions';
|
|
33
|
+
this.handleChangedSchema = debounce(this.doHandleChangedSchema, 200);
|
|
34
|
+
}
|
|
35
|
+
get root() {
|
|
36
|
+
var _a;
|
|
37
|
+
return (_a = this._root) !== null && _a !== void 0 ? _a : this.generateTree();
|
|
38
|
+
}
|
|
39
|
+
init() {
|
|
40
|
+
this.doInit();
|
|
41
|
+
}
|
|
42
|
+
async doInit() {
|
|
43
|
+
this.schemaProvider.onDidChangeSchema(() => this.handleChangedSchema());
|
|
44
|
+
this.handleChangedSchema();
|
|
45
|
+
}
|
|
46
|
+
generateTree() {
|
|
47
|
+
var _a;
|
|
48
|
+
this._idCache.clear();
|
|
49
|
+
const properties = this.schemaProvider.getSchemaProperties();
|
|
50
|
+
const groups = new Map();
|
|
51
|
+
const root = this.createRootNode();
|
|
52
|
+
const commonlyUsedLayout = this.layoutProvider.getCommonlyUsedLayout();
|
|
53
|
+
const commonlyUsed = this.getOrCreatePreferencesGroup({
|
|
54
|
+
id: commonlyUsedLayout.id,
|
|
55
|
+
group: commonlyUsedLayout.id,
|
|
56
|
+
root,
|
|
57
|
+
groups,
|
|
58
|
+
label: commonlyUsedLayout.label
|
|
59
|
+
});
|
|
60
|
+
for (const layout of this.layoutProvider.getLayout()) {
|
|
61
|
+
this.getOrCreatePreferencesGroup({
|
|
62
|
+
id: layout.id,
|
|
63
|
+
group: layout.id,
|
|
64
|
+
root,
|
|
65
|
+
groups,
|
|
66
|
+
label: layout.label
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
for (const preference of (_a = commonlyUsedLayout.settings) !== null && _a !== void 0 ? _a : []) {
|
|
70
|
+
if (properties.has(preference)) {
|
|
71
|
+
this.createLeafNode(preference, commonlyUsed, properties.get(preference));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
for (const [propertyName, property] of properties.entries()) {
|
|
75
|
+
if (!property.hidden && !property.deprecationMessage && !this.preferenceConfigs.isSectionName(propertyName) && !core_1.OVERRIDE_PROPERTY_PATTERN.test(propertyName)) {
|
|
76
|
+
if (property.owner) {
|
|
77
|
+
this.createPluginLeafNode(propertyName, property, root, groups);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
this.createBuiltinLeafNode(propertyName, property, root, groups);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
for (const group of groups.values()) {
|
|
85
|
+
if (group.id !== `${preference_layout_1.COMMONLY_USED_SECTION_PREFIX}@${preference_layout_1.COMMONLY_USED_SECTION_PREFIX}`) {
|
|
86
|
+
group.children.sort((a, b) => {
|
|
87
|
+
const aIsComposite = browser_1.CompositeTreeNode.is(a);
|
|
88
|
+
const bIsComposite = browser_1.CompositeTreeNode.is(b);
|
|
89
|
+
if (aIsComposite && !bIsComposite) {
|
|
90
|
+
return 1;
|
|
91
|
+
}
|
|
92
|
+
if (bIsComposite && !aIsComposite) {
|
|
93
|
+
return -1;
|
|
94
|
+
}
|
|
95
|
+
return a.id.localeCompare(b.id);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
this._root = root;
|
|
100
|
+
return root;
|
|
101
|
+
}
|
|
102
|
+
;
|
|
103
|
+
createBuiltinLeafNode(name, property, root, groups) {
|
|
104
|
+
const { immediateParent, topLevelParent } = this.getParents(name, root, groups);
|
|
105
|
+
this.createLeafNode(name, immediateParent || topLevelParent, property);
|
|
106
|
+
}
|
|
107
|
+
createPluginLeafNode(name, property, root, groups) {
|
|
108
|
+
if (!property.owner) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const groupID = this.defaultTopLevelCategory;
|
|
112
|
+
const subgroupName = property.owner;
|
|
113
|
+
const subsubgroupName = property.group;
|
|
114
|
+
const hasGroup = Boolean(subsubgroupName);
|
|
115
|
+
const toplevelParent = this.getOrCreatePreferencesGroup({
|
|
116
|
+
id: groupID,
|
|
117
|
+
group: groupID,
|
|
118
|
+
root,
|
|
119
|
+
groups
|
|
120
|
+
});
|
|
121
|
+
const subgroupID = [groupID, subgroupName].join('.');
|
|
122
|
+
const subgroupParent = this.getOrCreatePreferencesGroup({
|
|
123
|
+
id: subgroupID,
|
|
124
|
+
group: groupID,
|
|
125
|
+
root: toplevelParent,
|
|
126
|
+
groups,
|
|
127
|
+
expanded: hasGroup,
|
|
128
|
+
label: subgroupName
|
|
129
|
+
});
|
|
130
|
+
const subsubgroupID = [groupID, subgroupName, subsubgroupName].join('.');
|
|
131
|
+
const subsubgroupParent = hasGroup ? this.getOrCreatePreferencesGroup({
|
|
132
|
+
id: subsubgroupID,
|
|
133
|
+
group: subgroupID,
|
|
134
|
+
root: subgroupParent,
|
|
135
|
+
groups,
|
|
136
|
+
depth: 2,
|
|
137
|
+
label: subsubgroupName
|
|
138
|
+
}) : undefined;
|
|
139
|
+
this.createLeafNode(name, subsubgroupParent || subgroupParent, property);
|
|
140
|
+
}
|
|
141
|
+
getNodeId(preferenceId) {
|
|
142
|
+
var _a;
|
|
143
|
+
return (_a = this._idCache.get(preferenceId)) !== null && _a !== void 0 ? _a : '';
|
|
144
|
+
}
|
|
145
|
+
getParents(name, root, groups) {
|
|
146
|
+
var _a, _b;
|
|
147
|
+
const layoutItem = this.layoutProvider.getLayoutForPreference(name);
|
|
148
|
+
const labels = ((_a = layoutItem === null || layoutItem === void 0 ? void 0 : layoutItem.id) !== null && _a !== void 0 ? _a : name).split('.');
|
|
149
|
+
const groupID = this.getGroupName(labels);
|
|
150
|
+
const subgroupName = groupID !== labels[0]
|
|
151
|
+
? labels[0]
|
|
152
|
+
// If a layout item is present, any additional segments are sections
|
|
153
|
+
// If not, then the name describes a leaf node and only non-final segments are sections.
|
|
154
|
+
: layoutItem || labels.length > 2
|
|
155
|
+
? labels.at(1)
|
|
156
|
+
: undefined;
|
|
157
|
+
const topLevelParent = this.getOrCreatePreferencesGroup({
|
|
158
|
+
id: groupID,
|
|
159
|
+
group: groupID,
|
|
160
|
+
root,
|
|
161
|
+
groups,
|
|
162
|
+
label: this.generateName(groupID)
|
|
163
|
+
});
|
|
164
|
+
const immediateParent = subgroupName ? this.getOrCreatePreferencesGroup({
|
|
165
|
+
id: [groupID, subgroupName].join('.'),
|
|
166
|
+
group: groupID,
|
|
167
|
+
root: topLevelParent,
|
|
168
|
+
groups,
|
|
169
|
+
label: (_b = layoutItem === null || layoutItem === void 0 ? void 0 : layoutItem.label) !== null && _b !== void 0 ? _b : this.generateName(subgroupName)
|
|
170
|
+
}) : undefined;
|
|
171
|
+
return { immediateParent, topLevelParent };
|
|
172
|
+
}
|
|
173
|
+
getGroupName(labels) {
|
|
174
|
+
const defaultGroup = labels[0];
|
|
175
|
+
if (this.layoutProvider.hasCategory(defaultGroup)) {
|
|
176
|
+
return defaultGroup;
|
|
177
|
+
}
|
|
178
|
+
return this.defaultTopLevelCategory;
|
|
179
|
+
}
|
|
180
|
+
getSubgroupName(labels, computedGroupName) {
|
|
181
|
+
if (computedGroupName !== labels[0]) {
|
|
182
|
+
return labels[0];
|
|
183
|
+
}
|
|
184
|
+
else if (labels.length > 1) {
|
|
185
|
+
return labels[1];
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
return undefined;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
generateName(id) {
|
|
192
|
+
return this.labelProvider.formatString(id);
|
|
193
|
+
}
|
|
194
|
+
doHandleChangedSchema() {
|
|
195
|
+
const newTree = this.generateTree();
|
|
196
|
+
this.onSchemaChangedEmitter.fire(newTree);
|
|
197
|
+
}
|
|
198
|
+
createRootNode() {
|
|
199
|
+
return {
|
|
200
|
+
id: 'root-node-id',
|
|
201
|
+
name: '',
|
|
202
|
+
parent: undefined,
|
|
203
|
+
visible: true,
|
|
204
|
+
children: []
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
createLeafNode(property, preferencesGroup, data) {
|
|
208
|
+
const { group } = preference_types_1.Preference.TreeNode.getGroupAndIdFromNodeId(preferencesGroup.id);
|
|
209
|
+
const newNode = {
|
|
210
|
+
id: `${group}@${property}`,
|
|
211
|
+
preferenceId: property,
|
|
212
|
+
parent: preferencesGroup,
|
|
213
|
+
preference: { data },
|
|
214
|
+
depth: preference_types_1.Preference.TreeNode.isTopLevel(preferencesGroup) ? 1 : 2
|
|
215
|
+
};
|
|
216
|
+
this._idCache.set(property, newNode.id);
|
|
217
|
+
browser_1.CompositeTreeNode.addChild(preferencesGroup, newNode);
|
|
218
|
+
return newNode;
|
|
219
|
+
}
|
|
220
|
+
createPreferencesGroup(options) {
|
|
221
|
+
var _a, _b;
|
|
222
|
+
const newNode = {
|
|
223
|
+
id: `${options.group}@${options.id}`,
|
|
224
|
+
visible: true,
|
|
225
|
+
parent: options.root,
|
|
226
|
+
children: [],
|
|
227
|
+
expanded: false,
|
|
228
|
+
selected: false,
|
|
229
|
+
depth: 0,
|
|
230
|
+
label: options.label
|
|
231
|
+
};
|
|
232
|
+
const isTopLevel = preference_types_1.Preference.TreeNode.isTopLevel(newNode);
|
|
233
|
+
if (!((_a = options.expanded) !== null && _a !== void 0 ? _a : isTopLevel)) {
|
|
234
|
+
delete newNode.expanded;
|
|
235
|
+
}
|
|
236
|
+
newNode.depth = (_b = options.depth) !== null && _b !== void 0 ? _b : (isTopLevel ? 0 : 1);
|
|
237
|
+
browser_1.CompositeTreeNode.addChild(options.root, newNode);
|
|
238
|
+
return newNode;
|
|
239
|
+
}
|
|
240
|
+
getOrCreatePreferencesGroup(options) {
|
|
241
|
+
const existingGroup = options.groups.get(options.id);
|
|
242
|
+
if (existingGroup) {
|
|
243
|
+
return existingGroup;
|
|
244
|
+
}
|
|
245
|
+
const newNode = this.createPreferencesGroup(options);
|
|
246
|
+
options.groups.set(options.id, newNode);
|
|
247
|
+
return newNode;
|
|
248
|
+
}
|
|
249
|
+
;
|
|
250
|
+
};
|
|
251
|
+
exports.PreferenceTreeGenerator = PreferenceTreeGenerator;
|
|
252
|
+
tslib_1.__decorate([
|
|
253
|
+
(0, inversify_1.inject)(core_1.PreferenceSchemaService),
|
|
254
|
+
tslib_1.__metadata("design:type", Object)
|
|
255
|
+
], PreferenceTreeGenerator.prototype, "schemaProvider", void 0);
|
|
256
|
+
tslib_1.__decorate([
|
|
257
|
+
(0, inversify_1.inject)(core_1.PreferenceConfigurations),
|
|
258
|
+
tslib_1.__metadata("design:type", core_1.PreferenceConfigurations)
|
|
259
|
+
], PreferenceTreeGenerator.prototype, "preferenceConfigs", void 0);
|
|
260
|
+
tslib_1.__decorate([
|
|
261
|
+
(0, inversify_1.inject)(preference_layout_1.PreferenceLayoutProvider),
|
|
262
|
+
tslib_1.__metadata("design:type", preference_layout_1.PreferenceLayoutProvider)
|
|
263
|
+
], PreferenceTreeGenerator.prototype, "layoutProvider", void 0);
|
|
264
|
+
tslib_1.__decorate([
|
|
265
|
+
(0, inversify_1.inject)(preference_tree_label_provider_1.PreferenceTreeLabelProvider),
|
|
266
|
+
tslib_1.__metadata("design:type", preference_tree_label_provider_1.PreferenceTreeLabelProvider)
|
|
267
|
+
], PreferenceTreeGenerator.prototype, "labelProvider", void 0);
|
|
268
|
+
tslib_1.__decorate([
|
|
269
|
+
(0, inversify_1.postConstruct)(),
|
|
270
|
+
tslib_1.__metadata("design:type", Function),
|
|
271
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
272
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
273
|
+
], PreferenceTreeGenerator.prototype, "init", null);
|
|
274
|
+
exports.PreferenceTreeGenerator = PreferenceTreeGenerator = tslib_1.__decorate([
|
|
275
|
+
(0, inversify_1.injectable)()
|
|
276
|
+
], PreferenceTreeGenerator);
|
|
277
|
+
//# sourceMappingURL=preference-tree-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preference-tree-generator.js","sourceRoot":"","sources":["../../../src/browser/util/preference-tree-generator.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,4DAAiF;AACjF,qDAA4D;AAC5D,sCAA4I;AAC5I,+DAAgE;AAChE,yDAAgD;AAChD,2DAA6F;AAC7F,qFAA+E;AAYxE,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAA7B;QAQO,aAAQ,GAAG,IAAI,GAAG,EAA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,CAAA;AAnPY,0DAAuB;AAEoB;IAAnD,IAAA,kBAAM,EAAC,8BAAuB,CAAC;;+DAA4D;AACvC;IAApD,IAAA,kBAAM,EAAC,+BAAwB,CAAC;sCAAuC,+BAAwB;kEAAC;AAC5C;IAApD,IAAA,kBAAM,EAAC,4CAAwB,CAAC;sCAAoC,4CAAwB;+DAAC;AACtC;IAAvD,IAAA,kBAAM,EAAC,4DAA2B,CAAC;sCAAmC,4DAA2B;8DAAC;AAczF;IADT,IAAA,yBAAa,GAAE;;;;mDAGf;kCArBQ,uBAAuB;IADnC,IAAA,sBAAU,GAAE;GACA,uBAAuB,CAmPnC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LabelProviderContribution } from '@theia/core/lib/browser';
|
|
2
|
+
import { Preference } from './preference-types';
|
|
3
|
+
import { PreferenceLayoutProvider } from './preference-layout';
|
|
4
|
+
export declare class PreferenceTreeLabelProvider implements LabelProviderContribution {
|
|
5
|
+
protected readonly layoutProvider: PreferenceLayoutProvider;
|
|
6
|
+
canHandle(element: object): number;
|
|
7
|
+
getName(node: Preference.TreeNode): string;
|
|
8
|
+
getPrefix(node: Preference.TreeNode, fullPath?: boolean): string | undefined;
|
|
9
|
+
formatString(string: string): string;
|
|
10
|
+
protected isUpperCase(char: string): boolean;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=preference-tree-label-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preference-tree-label-provider.d.ts","sourceRoot":"","sources":["../../../src/browser/util/preference-tree-label-provider.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,yBAAyB,EAAY,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,qBACa,2BAA4B,YAAW,yBAAyB;IAGzE,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,wBAAwB,CAAC;IAE5D,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAIlC,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,GAAG,MAAM;IAU1C,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,EAAE,QAAQ,UAAQ,GAAG,MAAM,GAAG,SAAS;IAgB1E,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAWpC,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;CAG/C"}
|
|
@@ -0,0 +1,74 @@
|
|
|
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.PreferenceTreeLabelProvider = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
22
|
+
const preference_types_1 = require("./preference-types");
|
|
23
|
+
const preference_layout_1 = require("./preference-layout");
|
|
24
|
+
let PreferenceTreeLabelProvider = class PreferenceTreeLabelProvider {
|
|
25
|
+
canHandle(element) {
|
|
26
|
+
return browser_1.TreeNode.is(element) && preference_types_1.Preference.TreeNode.is(element) ? 150 : 0;
|
|
27
|
+
}
|
|
28
|
+
getName(node) {
|
|
29
|
+
if (preference_types_1.Preference.TreeNode.is(node) && node.label) {
|
|
30
|
+
return node.label;
|
|
31
|
+
}
|
|
32
|
+
const { id } = preference_types_1.Preference.TreeNode.getGroupAndIdFromNodeId(node.id);
|
|
33
|
+
const labels = id.split('.');
|
|
34
|
+
const groupName = labels[labels.length - 1];
|
|
35
|
+
return this.formatString(groupName);
|
|
36
|
+
}
|
|
37
|
+
getPrefix(node, fullPath = false) {
|
|
38
|
+
const { depth } = node;
|
|
39
|
+
const { id, group } = preference_types_1.Preference.TreeNode.getGroupAndIdFromNodeId(node.id);
|
|
40
|
+
const segments = id.split('.');
|
|
41
|
+
const segmentsHandled = group === segments[0] ? depth : depth - 1;
|
|
42
|
+
segments.pop(); // Ignore the leaf name.
|
|
43
|
+
const prefixSegments = fullPath ? segments : segments.slice(segmentsHandled);
|
|
44
|
+
if (prefixSegments.length) {
|
|
45
|
+
let output = prefixSegments.length > 1 ? `${this.formatString(prefixSegments[0])} › ` : `${this.formatString(prefixSegments[0])}: `;
|
|
46
|
+
for (const segment of prefixSegments.slice(1)) {
|
|
47
|
+
output += `${this.formatString(segment)}: `;
|
|
48
|
+
}
|
|
49
|
+
return output;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
formatString(string) {
|
|
53
|
+
let formattedString = string[0].toLocaleUpperCase();
|
|
54
|
+
for (let i = 1; i < string.length; i++) {
|
|
55
|
+
if (this.isUpperCase(string[i]) && !/\s/.test(string[i - 1]) && !this.isUpperCase(string[i - 1])) {
|
|
56
|
+
formattedString += ' ';
|
|
57
|
+
}
|
|
58
|
+
formattedString += string[i];
|
|
59
|
+
}
|
|
60
|
+
return formattedString.trim();
|
|
61
|
+
}
|
|
62
|
+
isUpperCase(char) {
|
|
63
|
+
return char === char.toLocaleUpperCase() && char.toLocaleLowerCase() !== char.toLocaleUpperCase();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
exports.PreferenceTreeLabelProvider = PreferenceTreeLabelProvider;
|
|
67
|
+
tslib_1.__decorate([
|
|
68
|
+
(0, inversify_1.inject)(preference_layout_1.PreferenceLayoutProvider),
|
|
69
|
+
tslib_1.__metadata("design:type", preference_layout_1.PreferenceLayoutProvider)
|
|
70
|
+
], PreferenceTreeLabelProvider.prototype, "layoutProvider", void 0);
|
|
71
|
+
exports.PreferenceTreeLabelProvider = PreferenceTreeLabelProvider = tslib_1.__decorate([
|
|
72
|
+
(0, inversify_1.injectable)()
|
|
73
|
+
], PreferenceTreeLabelProvider);
|
|
74
|
+
//# sourceMappingURL=preference-tree-label-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preference-tree-label-provider.js","sourceRoot":"","sources":["../../../src/browser/util/preference-tree-label-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,qDAA8E;AAC9E,yDAAgD;AAChD,2DAA+D;AAGxD,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IAKpC,SAAS,CAAC,OAAe;QACrB,OAAO,kBAAQ,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,6BAAU,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,CAAC;IAED,OAAO,CAAC,IAAyB;QAC7B,IAAI,6BAAU,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC7C,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M,OAAO,IAAI,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC;YAChD,CAAC;YACD,OAAO,MAAM,CAAC;QAClB,CAAC;IACL,CAAC;IAED,YAAY,CAAC,MAAc;QACvB,IAAI,eAAe,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;QACpD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACrC,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC/F,eAAe,IAAI,GAAG,CAAC;YAC3B,CAAC;YACD,eAAe,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,eAAe,CAAC,IAAI,EAAE,CAAC;IAClC,CAAC;IAES,WAAW,CAAC,IAAY;QAC9B,OAAO,IAAI,KAAK,IAAI,CAAC,iBAAiB,EAAE,IAAI,IAAI,CAAC,iBAAiB,EAAE,KAAK,IAAI,CAAC,iBAAiB,EAAE,CAAC;IACtG,CAAC;CACJ,CAAA;AAjDY,kEAA2B;AAGjB;IADlB,IAAA,kBAAM,EAAC,4CAAwB,CAAC;sCACE,4CAAwB;mEAAC;sCAHnD,2BAA2B;IADvC,IAAA,sBAAU,GAAE;GACA,2BAA2B,CAiDvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preference-tree-label-provider.spec.d.ts","sourceRoot":"","sources":["../../../src/browser/util/preference-tree-label-provider.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2020 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
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
19
|
+
const jsdom_1 = require("@theia/core/lib/browser/test/jsdom");
|
|
20
|
+
const disableJSDOM = (0, jsdom_1.enableJSDOM)();
|
|
21
|
+
const frontend_application_config_provider_1 = require("@theia/core/lib/browser/frontend-application-config-provider");
|
|
22
|
+
frontend_application_config_provider_1.FrontendApplicationConfigProvider.set({});
|
|
23
|
+
const chai_1 = require("chai");
|
|
24
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
25
|
+
const preference_tree_generator_1 = require("./preference-tree-generator");
|
|
26
|
+
const preference_tree_label_provider_1 = require("./preference-tree-label-provider");
|
|
27
|
+
const preference_layout_1 = require("./preference-layout");
|
|
28
|
+
disableJSDOM();
|
|
29
|
+
describe('preference-tree-label-provider', () => {
|
|
30
|
+
let preferenceTreeLabelProvider;
|
|
31
|
+
beforeEach(() => {
|
|
32
|
+
const container = new inversify_1.Container();
|
|
33
|
+
container.bind(preference_layout_1.PreferenceLayoutProvider).toSelf().inSingletonScope();
|
|
34
|
+
container.bind(preference_tree_generator_1.PreferenceTreeGenerator).toConstantValue({ getCustomLabelFor: () => { } });
|
|
35
|
+
preferenceTreeLabelProvider = container.resolve(preference_tree_label_provider_1.PreferenceTreeLabelProvider);
|
|
36
|
+
});
|
|
37
|
+
it('PreferenceTreeLabelProvider.format', () => {
|
|
38
|
+
const testString = 'aaaBbbCcc Dddd eee';
|
|
39
|
+
(0, chai_1.expect)(preferenceTreeLabelProvider['formatString'](testString)).eq('Aaa Bbb Ccc Dddd eee');
|
|
40
|
+
});
|
|
41
|
+
it('PreferenceTreeLabelProvider.format.Chinese', () => {
|
|
42
|
+
const testString = '某個設定/某个设定';
|
|
43
|
+
(0, chai_1.expect)(preferenceTreeLabelProvider['formatString'](testString)).eq('某個設定/某个设定');
|
|
44
|
+
});
|
|
45
|
+
it('PreferenceTreeLabelProvider.format.Danish', () => {
|
|
46
|
+
const testString = 'indstillingPåEnØ';
|
|
47
|
+
(0, chai_1.expect)(preferenceTreeLabelProvider['formatString'](testString)).eq('Indstilling På En Ø');
|
|
48
|
+
});
|
|
49
|
+
it('PreferenceTreeLabelProvider.format.Greek', () => {
|
|
50
|
+
const testString = 'κάποιαΡύθμιση';
|
|
51
|
+
(0, chai_1.expect)(preferenceTreeLabelProvider['formatString'](testString)).eq('Κάποια Ρύθμιση');
|
|
52
|
+
});
|
|
53
|
+
it('PreferenceTreeLabelProvider.format.Russian', () => {
|
|
54
|
+
const testString = 'некоторыеНастройки';
|
|
55
|
+
(0, chai_1.expect)(preferenceTreeLabelProvider['formatString'](testString)).eq('Некоторые Настройки');
|
|
56
|
+
});
|
|
57
|
+
it('PreferenceTreeLabelProvider.format.Armenian', () => {
|
|
58
|
+
const testString = 'ինչ-որՊարամետր';
|
|
59
|
+
(0, chai_1.expect)(preferenceTreeLabelProvider['formatString'](testString)).eq('Ինչ-որ Պարամետր');
|
|
60
|
+
});
|
|
61
|
+
it('PreferenceTreeLabelProvider.format.specialCharacters', () => {
|
|
62
|
+
const testString = 'hyphenated-wordC++Setting';
|
|
63
|
+
(0, chai_1.expect)(preferenceTreeLabelProvider['formatString'](testString)).eq('Hyphenated-word C++ Setting');
|
|
64
|
+
});
|
|
65
|
+
describe('PreferenceTreeLabelProvider.createLeafNode', () => {
|
|
66
|
+
it('when property constructs of three parts the third part is the leaf', () => {
|
|
67
|
+
const property = 'category-name.subcategory.leaf';
|
|
68
|
+
const expectedName = 'Leaf';
|
|
69
|
+
testLeafName(property, expectedName);
|
|
70
|
+
});
|
|
71
|
+
it('when property constructs of two parts the second part is the leaf', () => {
|
|
72
|
+
const property = 'category-name.leaf';
|
|
73
|
+
const expectedName = 'Leaf';
|
|
74
|
+
testLeafName(property, expectedName);
|
|
75
|
+
});
|
|
76
|
+
function testLeafName(property, expectedName) {
|
|
77
|
+
const expectedSelectableTreeNode = {
|
|
78
|
+
id: `group@${property}`,
|
|
79
|
+
parent: undefined,
|
|
80
|
+
visible: true,
|
|
81
|
+
selected: false,
|
|
82
|
+
depth: 2,
|
|
83
|
+
preferenceId: property,
|
|
84
|
+
preference: { data: {} }
|
|
85
|
+
};
|
|
86
|
+
(0, chai_1.expect)(preferenceTreeLabelProvider['getName'](expectedSelectableTreeNode)).deep.eq(expectedName);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
//# sourceMappingURL=preference-tree-label-provider.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preference-tree-label-provider.spec.js","sourceRoot":"","sources":["../../../src/browser/util/preference-tree-label-provider.spec.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;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CAAC,CAAC;QAEH,EAAE,CAAC,mEAAmE,EAAE,GAAG,EAAE;YACzE,MAAM,QAAQ,GAAG,oBAAoB,CAAC;YACtC,MAAM,YAAY,GAAG,MAAM,CAAC;YAC5B,YAAY,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QAEH,SAAS,YAAY,CAAC,QAAgB,EAAE,YAAoB;YAExD,MAAM,0BAA0B,GAA6C;gBACzE,EAAE,EAAE,SAAS,QAAQ,EAAE;gBACvB,MAAM,EAAE,SAAS;gBACjB,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,KAAK;gBACf,KAAK,EAAE,CAAC;gBACR,YAAY,EAAE,QAAQ;gBACtB,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;aAC3B,CAAC;YAEF,IAAA,aAAM,EAAC,2BAA2B,CAAC,SAAS,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;QACrG,CAAC;IAEL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { TreeNode as BaseTreeNode, CompositeTreeNode as BaseCompositeTreeNode, SelectableTreeNode } from '@theia/core/lib/browser';
|
|
2
|
+
import { Command, MenuPath, PreferenceDataProperty, PreferenceInspection } from '@theia/core';
|
|
3
|
+
import { JSONValue } from '@theia/core/shared/@lumino/coreutils';
|
|
4
|
+
import { JsonType } from '@theia/core/lib/common/json-schema';
|
|
5
|
+
export declare namespace Preference {
|
|
6
|
+
interface EditorCommandArgs {
|
|
7
|
+
id: string;
|
|
8
|
+
value: string | undefined;
|
|
9
|
+
}
|
|
10
|
+
namespace EditorCommandArgs {
|
|
11
|
+
function is(prefObject: EditorCommandArgs): prefObject is EditorCommandArgs;
|
|
12
|
+
}
|
|
13
|
+
const Node: unique symbol;
|
|
14
|
+
type Node = TreeNode;
|
|
15
|
+
type TreeNode = CompositeTreeNode | LeafNode;
|
|
16
|
+
namespace TreeNode {
|
|
17
|
+
const is: (node: BaseTreeNode | TreeNode) => node is TreeNode;
|
|
18
|
+
const isTopLevel: (node: BaseTreeNode) => boolean;
|
|
19
|
+
const getGroupAndIdFromNodeId: (nodeId: string) => {
|
|
20
|
+
group: string;
|
|
21
|
+
id: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
interface CompositeTreeNode extends BaseCompositeTreeNode, SelectableTreeNode {
|
|
25
|
+
expanded?: boolean;
|
|
26
|
+
depth: number;
|
|
27
|
+
label?: string;
|
|
28
|
+
}
|
|
29
|
+
namespace CompositeTreeNode {
|
|
30
|
+
const is: (node: TreeNode) => node is CompositeTreeNode;
|
|
31
|
+
}
|
|
32
|
+
interface LeafNode extends BaseTreeNode {
|
|
33
|
+
label?: string;
|
|
34
|
+
depth: number;
|
|
35
|
+
preference: {
|
|
36
|
+
data: PreferenceDataProperty;
|
|
37
|
+
};
|
|
38
|
+
preferenceId: string;
|
|
39
|
+
}
|
|
40
|
+
namespace LeafNode {
|
|
41
|
+
const is: (node: BaseTreeNode | LeafNode) => node is LeafNode;
|
|
42
|
+
const getType: (node: BaseTreeNode | LeafNode) => JsonType | undefined;
|
|
43
|
+
}
|
|
44
|
+
const getValueInScope: <T extends JSONValue>(preferenceInfo: PreferenceInspection<T> | undefined, scope: number) => T | undefined;
|
|
45
|
+
interface SelectedScopeDetails {
|
|
46
|
+
scope: number;
|
|
47
|
+
uri: string | undefined;
|
|
48
|
+
activeScopeIsFolder: boolean;
|
|
49
|
+
}
|
|
50
|
+
const DEFAULT_SCOPE: SelectedScopeDetails;
|
|
51
|
+
}
|
|
52
|
+
export declare namespace PreferencesCommands {
|
|
53
|
+
const OPEN_PREFERENCES_JSON_TOOLBAR: Command;
|
|
54
|
+
const COPY_JSON_NAME: Command;
|
|
55
|
+
const RESET_PREFERENCE: Command;
|
|
56
|
+
const COPY_JSON_VALUE: Command;
|
|
57
|
+
const OPEN_USER_PREFERENCES: Command;
|
|
58
|
+
const OPEN_WORKSPACE_PREFERENCES: Command;
|
|
59
|
+
const OPEN_FOLDER_PREFERENCES: Command;
|
|
60
|
+
const OPEN_USER_PREFERENCES_JSON: Command;
|
|
61
|
+
const OPEN_WORKSPACE_PREFERENCES_JSON: Command;
|
|
62
|
+
const OPEN_FOLDER_PREFERENCES_JSON: Command;
|
|
63
|
+
}
|
|
64
|
+
export declare namespace PreferenceMenus {
|
|
65
|
+
const PREFERENCE_EDITOR_CONTEXT_MENU: MenuPath;
|
|
66
|
+
const PREFERENCE_EDITOR_COPY_ACTIONS: MenuPath;
|
|
67
|
+
const FOLDER_SCOPE_MENU_PATH: string[];
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=preference-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preference-types.d.ts","sourceRoot":"","sources":["../../../src/browser/util/preference-types.ts"],"names":[],"mappings":"AAgBA,OAAO,EACH,QAAQ,IAAI,YAAY,EACxB,iBAAiB,IAAI,qBAAqB,EAC1C,kBAAkB,EAErB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,oBAAoB,EAAmB,MAAM,aAAa,CAAC;AAC/G,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAE9D,yBAAiB,UAAU,CAAC;IAExB,UAAiB,iBAAiB;QAC9B,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;KAC7B;IAED,UAAiB,iBAAiB,CAAC;QAC/B,SAAgB,EAAE,CAAC,UAAU,EAAE,iBAAiB,GAAG,UAAU,IAAI,iBAAiB,CAEjF;KACJ;IAEM,MAAM,IAAI,eAA4B,CAAC;IAC9C,KAAY,IAAI,GAAG,QAAQ,CAAC;IAE5B,KAAY,QAAQ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