1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | Object.defineProperty(exports, "__esModule", { value: true });
|
18 | exports.PreferenceScope = void 0;
|
19 | var PreferenceScope;
|
20 | (function (PreferenceScope) {
|
21 | PreferenceScope[PreferenceScope["Default"] = 0] = "Default";
|
22 | PreferenceScope[PreferenceScope["User"] = 1] = "User";
|
23 | PreferenceScope[PreferenceScope["Workspace"] = 2] = "Workspace";
|
24 | PreferenceScope[PreferenceScope["Folder"] = 3] = "Folder";
|
25 | })(PreferenceScope = exports.PreferenceScope || (exports.PreferenceScope = {}));
|
26 | (function (PreferenceScope) {
|
27 | function is(scope) {
|
28 | return typeof scope === 'number' && getScopes().includes(scope);
|
29 | }
|
30 | PreferenceScope.is = is;
|
31 | |
32 |
|
33 |
|
34 | function getScopes() {
|
35 | return Object.values(PreferenceScope).filter(nameOrIndex => !isNaN(Number(nameOrIndex)));
|
36 | }
|
37 | PreferenceScope.getScopes = getScopes;
|
38 | |
39 |
|
40 |
|
41 | function getReversedScopes() {
|
42 | return getScopes().reverse();
|
43 | }
|
44 | PreferenceScope.getReversedScopes = getReversedScopes;
|
45 | function getScopeNames(scope) {
|
46 | const names = [];
|
47 | const scopes = getScopes();
|
48 | if (scope) {
|
49 | for (const scopeIndex of scopes) {
|
50 | if (scopeIndex <= scope) {
|
51 | names.push(PreferenceScope[scopeIndex]);
|
52 | }
|
53 | }
|
54 | }
|
55 | return names;
|
56 | }
|
57 | PreferenceScope.getScopeNames = getScopeNames;
|
58 | function fromString(strScope) {
|
59 | switch (strScope) {
|
60 | case 'application':
|
61 | return PreferenceScope.User;
|
62 | case 'window':
|
63 | return PreferenceScope.Folder;
|
64 | case 'resource':
|
65 | return PreferenceScope.Folder;
|
66 | case 'language-overridable':
|
67 | return PreferenceScope.Folder;
|
68 | }
|
69 | }
|
70 | PreferenceScope.fromString = fromString;
|
71 | })(PreferenceScope = exports.PreferenceScope || (exports.PreferenceScope = {}));
|
72 |
|
\ | No newline at end of file |