@theia/preferences 1.49.1 → 1.50.1

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.
Files changed (101) hide show
  1. package/lib/browser/abstract-resource-preference-provider.js +14 -14
  2. package/lib/browser/abstract-resource-preference-provider.js.map +1 -1
  3. package/lib/browser/folder-preference-provider.js +4 -4
  4. package/lib/browser/folder-preference-provider.js.map +1 -1
  5. package/lib/browser/folders-preferences-provider.js +12 -12
  6. package/lib/browser/folders-preferences-provider.js.map +1 -1
  7. package/lib/browser/index.js +7 -7
  8. package/lib/browser/index.js.map +1 -1
  9. package/lib/browser/monaco-jsonc-editor.js +6 -6
  10. package/lib/browser/monaco-jsonc-editor.js.map +1 -1
  11. package/lib/browser/preference-bindings.js.map +1 -1
  12. package/lib/browser/preference-frontend-contribution.d.ts +9 -0
  13. package/lib/browser/preference-frontend-contribution.d.ts.map +1 -0
  14. package/lib/browser/preference-frontend-contribution.js +45 -0
  15. package/lib/browser/preference-frontend-contribution.js.map +1 -0
  16. package/lib/browser/preference-frontend-module.d.ts.map +1 -1
  17. package/lib/browser/preference-frontend-module.js +6 -0
  18. package/lib/browser/preference-frontend-module.js.map +1 -1
  19. package/lib/browser/preference-open-handler.js +4 -4
  20. package/lib/browser/preference-open-handler.js.map +1 -1
  21. package/lib/browser/preference-transaction-manager.d.ts +1 -1
  22. package/lib/browser/preference-transaction-manager.d.ts.map +1 -1
  23. package/lib/browser/preference-transaction-manager.js +21 -25
  24. package/lib/browser/preference-transaction-manager.js.map +1 -1
  25. package/lib/browser/preference-tree-model.js +17 -17
  26. package/lib/browser/preference-tree-model.js.map +1 -1
  27. package/lib/browser/preferences-contribution.js +21 -21
  28. package/lib/browser/preferences-contribution.js.map +1 -1
  29. package/lib/browser/preferences-json-schema-contribution.js +10 -10
  30. package/lib/browser/preferences-json-schema-contribution.js.map +1 -1
  31. package/lib/browser/section-preference-provider.js +10 -10
  32. package/lib/browser/section-preference-provider.js.map +1 -1
  33. package/lib/browser/user-configs-preference-provider.js +10 -10
  34. package/lib/browser/user-configs-preference-provider.js.map +1 -1
  35. package/lib/browser/user-preference-provider.js +2 -2
  36. package/lib/browser/user-preference-provider.js.map +1 -1
  37. package/lib/browser/util/preference-scope-command-manager.js +8 -8
  38. package/lib/browser/util/preference-scope-command-manager.js.map +1 -1
  39. package/lib/browser/util/preference-tree-generator.js +10 -10
  40. package/lib/browser/util/preference-tree-generator.js.map +1 -1
  41. package/lib/browser/util/preference-tree-label-provider.js +4 -4
  42. package/lib/browser/util/preference-tree-label-provider.js.map +1 -1
  43. package/lib/browser/util/preference-types.d.ts.map +1 -1
  44. package/lib/browser/util/preference-types.js +3 -3
  45. package/lib/browser/util/preference-types.js.map +1 -1
  46. package/lib/browser/views/components/preference-array-input.js +4 -4
  47. package/lib/browser/views/components/preference-array-input.js.map +1 -1
  48. package/lib/browser/views/components/preference-boolean-input.js +4 -4
  49. package/lib/browser/views/components/preference-boolean-input.js.map +1 -1
  50. package/lib/browser/views/components/preference-file-input.js +7 -7
  51. package/lib/browser/views/components/preference-file-input.js.map +1 -1
  52. package/lib/browser/views/components/preference-json-input.js +6 -6
  53. package/lib/browser/views/components/preference-json-input.js.map +1 -1
  54. package/lib/browser/views/components/preference-markdown-renderer.js +6 -6
  55. package/lib/browser/views/components/preference-markdown-renderer.js.map +1 -1
  56. package/lib/browser/views/components/preference-node-renderer-creator.js +9 -9
  57. package/lib/browser/views/components/preference-node-renderer-creator.js.map +1 -1
  58. package/lib/browser/views/components/preference-node-renderer.d.ts +1 -1
  59. package/lib/browser/views/components/preference-node-renderer.d.ts.map +1 -1
  60. package/lib/browser/views/components/preference-node-renderer.js +32 -32
  61. package/lib/browser/views/components/preference-node-renderer.js.map +1 -1
  62. package/lib/browser/views/components/preference-number-input.js +4 -4
  63. package/lib/browser/views/components/preference-number-input.js.map +1 -1
  64. package/lib/browser/views/components/preference-select-input.js +4 -4
  65. package/lib/browser/views/components/preference-select-input.js.map +1 -1
  66. package/lib/browser/views/components/preference-string-input.js +4 -4
  67. package/lib/browser/views/components/preference-string-input.js.map +1 -1
  68. package/lib/browser/views/preference-editor-widget.js +18 -18
  69. package/lib/browser/views/preference-editor-widget.js.map +1 -1
  70. package/lib/browser/views/preference-scope-tabbar-widget.js +18 -18
  71. package/lib/browser/views/preference-scope-tabbar-widget.js.map +1 -1
  72. package/lib/browser/views/preference-searchbar-widget.js +8 -8
  73. package/lib/browser/views/preference-searchbar-widget.js.map +1 -1
  74. package/lib/browser/views/preference-tree-widget.js +10 -10
  75. package/lib/browser/views/preference-tree-widget.js.map +1 -1
  76. package/lib/browser/views/preference-widget.js +14 -14
  77. package/lib/browser/views/preference-widget.js.map +1 -1
  78. package/lib/browser/workspace-file-preference-provider.d.ts +1 -1
  79. package/lib/browser/workspace-file-preference-provider.d.ts.map +1 -1
  80. package/lib/browser/workspace-file-preference-provider.js +8 -8
  81. package/lib/browser/workspace-file-preference-provider.js.map +1 -1
  82. package/lib/browser/workspace-preference-provider.js +12 -12
  83. package/lib/browser/workspace-preference-provider.js.map +1 -1
  84. package/lib/common/cli-preferences.d.ts +6 -0
  85. package/lib/common/cli-preferences.d.ts.map +1 -0
  86. package/lib/common/cli-preferences.js +21 -0
  87. package/lib/common/cli-preferences.js.map +1 -0
  88. package/lib/node/preference-backend-module.d.ts +4 -0
  89. package/lib/node/preference-backend-module.d.ts.map +1 -0
  90. package/lib/node/preference-backend-module.js +32 -0
  91. package/lib/node/preference-backend-module.js.map +1 -0
  92. package/lib/node/preference-cli-contribution.d.ts +11 -0
  93. package/lib/node/preference-cli-contribution.d.ts.map +1 -0
  94. package/lib/node/preference-cli-contribution.js +48 -0
  95. package/lib/node/preference-cli-contribution.js.map +1 -0
  96. package/package.json +11 -10
  97. package/src/browser/preference-frontend-contribution.ts +38 -0
  98. package/src/browser/preference-frontend-module.ts +8 -1
  99. package/src/common/cli-preferences.ts +22 -0
  100. package/src/node/preference-backend-module.ts +33 -0
  101. package/src/node/preference-cli-contribution.ts +48 -0
@@ -109,27 +109,27 @@ let WorkspacePreferenceProvider = class WorkspacePreferenceProvider extends pref
109
109
  return undefined;
110
110
  }
111
111
  };
112
- (0, tslib_1.__decorate)([
112
+ exports.WorkspacePreferenceProvider = WorkspacePreferenceProvider;
113
+ tslib_1.__decorate([
113
114
  (0, inversify_1.inject)(workspace_service_1.WorkspaceService),
114
- (0, tslib_1.__metadata)("design:type", workspace_service_1.WorkspaceService)
115
+ tslib_1.__metadata("design:type", workspace_service_1.WorkspaceService)
115
116
  ], WorkspacePreferenceProvider.prototype, "workspaceService", void 0);
116
- (0, tslib_1.__decorate)([
117
+ tslib_1.__decorate([
117
118
  (0, inversify_1.inject)(workspace_file_preference_provider_1.WorkspaceFilePreferenceProviderFactory),
118
- (0, tslib_1.__metadata)("design:type", Function)
119
+ tslib_1.__metadata("design:type", Function)
119
120
  ], WorkspacePreferenceProvider.prototype, "workspaceFileProviderFactory", void 0);
120
- (0, tslib_1.__decorate)([
121
+ tslib_1.__decorate([
121
122
  (0, inversify_1.inject)(preferences_1.PreferenceProvider),
122
123
  (0, inversify_1.named)(preferences_1.PreferenceScope.Folder),
123
- (0, tslib_1.__metadata)("design:type", preferences_1.PreferenceProvider)
124
+ tslib_1.__metadata("design:type", preferences_1.PreferenceProvider)
124
125
  ], WorkspacePreferenceProvider.prototype, "folderPreferenceProvider", void 0);
125
- (0, tslib_1.__decorate)([
126
+ tslib_1.__decorate([
126
127
  (0, inversify_1.postConstruct)(),
127
- (0, tslib_1.__metadata)("design:type", Function),
128
- (0, tslib_1.__metadata)("design:paramtypes", []),
129
- (0, tslib_1.__metadata)("design:returntype", void 0)
128
+ tslib_1.__metadata("design:type", Function),
129
+ tslib_1.__metadata("design:paramtypes", []),
130
+ tslib_1.__metadata("design:returntype", void 0)
130
131
  ], WorkspacePreferenceProvider.prototype, "init", null);
131
- WorkspacePreferenceProvider = (0, tslib_1.__decorate)([
132
+ exports.WorkspacePreferenceProvider = WorkspacePreferenceProvider = tslib_1.__decorate([
132
133
  (0, inversify_1.injectable)()
133
134
  ], WorkspacePreferenceProvider);
134
- exports.WorkspacePreferenceProvider = WorkspacePreferenceProvider;
135
135
  //# sourceMappingURL=workspace-preference-provider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-preference-provider.js","sourceRoot":"","sources":["../../src/browser/workspace-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,4DAAwF;AAExF,kEAAyE;AACzE,qEAA0F;AAC1F,sFAAkF;AAClF,6FAA+H;AAG/H,IAAa,2BAA2B,GAAxC,MAAa,2BAA4B,SAAQ,gCAAkB;IAAnE;;QAWuB,sCAAiC,GAAG,IAAI,iCAAoB,EAAE,CAAC;IAgGtF,CAAC;IA7Fa,IAAI;QACV,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;YAClC,kIAAkI;YAClI,+GAA+G;YAC/G,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE;gBAClC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;aACzB;QACL,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,gBAAgB,CAAC,0BAA0B,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAC;QACtF,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAC;IAClF,CAAC;IAEQ,YAAY,CAAC,cAAkC,IAAI,CAAC,iBAAiB,EAAE,EAAE,WAAoB;;QAClG,OAAO,MAAA,IAAI,CA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QAAQ,CAAC,aAAa,CAAC,cAAc,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;SACrE;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAES,iBAAiB;QACvB,IAAI,IAAI,CAAC,gBAAgB,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,0BAA0B,EAAE;YACtF,OAAO,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;SAC9D;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;CAEJ,CAAA;AAxGG;IADC,IAAA,kBAAM,EAAC,oCAAgB,CAAC;2CACY,oCAAgB;qEAAC;AAGtD;IADC,IAAA,kBAAM,EAAC,2EAAsC,CAAC;;iFACyC;AAGxF;IADC,IAAA,kBAAM,EAAC,gCAAkB,CAAC;IAAE,IAAA,iBAAK,EAAC,6BAAe,CAAC,MAAM,CAAC;2CACb,gCAAkB;6EAAC;AAKhE;IADC,IAAA,yBAAa,GAAE;;;;uDAWf;AAxBQ,2BAA2B;IADvC,IAAA,sBAAU,GAAE;GACA,2BAA2B,CA2GvC;AA3GY,kEAA2B"}
1
+ {"version":3,"file":"workspace-preference-provider.js","sourceRoot":"","sources":["../../src/browser/workspace-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,4DAAwF;AAExF,kEAAyE;AACzE,qEAA0F;AAC1F,sFAAkF;AAClF,6FAA+H;AAGxH,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,gCAAkB;IAA5D;;QAWgB,sCAAiC,GAAG,IAAI,iCAAoB,EAAE,CAAC;IAgG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BAAK,EAAC,6BAAe,CAAC,MAAM,CAAC;sCACb,gCAAkB;6EAAC;AAKtD;IADT,IAAA,yBAAa,GAAE;;;;uDAWf;sCAxBQ,2BAA2B;IADvC,IAAA,sBAAU,GAAE;GACA,2BAA2B,CA2GvC"}
@@ -0,0 +1,6 @@
1
+ export declare const CliPreferences: unique symbol;
2
+ export declare const CliPreferencesPath = "/services/cli-preferences";
3
+ export interface CliPreferences {
4
+ getPreferences(): Promise<[string, unknown][]>;
5
+ }
6
+ //# sourceMappingURL=cli-preferences.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-preferences.d.ts","sourceRoot":"","sources":["../../src/common/cli-preferences.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,cAAc,eAA2B,CAAC;AACvD,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D,MAAM,WAAW,cAAc;IAC3B,cAAc,IAAI,OAAO,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;CAClD"}
@@ -0,0 +1,21 @@
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
+ exports.CliPreferencesPath = exports.CliPreferences = void 0;
19
+ exports.CliPreferences = Symbol('CliPreferences');
20
+ exports.CliPreferencesPath = '/services/cli-preferences';
21
+ //# sourceMappingURL=cli-preferences.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-preferences.js","sourceRoot":"","sources":["../../src/common/cli-preferences.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;;;AAEnE,QAAA,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAC1C,QAAA,kBAAkB,GAAG,2BAA2B,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { ContainerModule } from '@theia/core/shared/inversify';
2
+ declare const _default: ContainerModule;
3
+ export default _default;
4
+ //# sourceMappingURL=preference-backend-module.d.ts.map
@@ -0,0 +1 @@
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;;AAU/D,wBAMG"}
@@ -0,0 +1,32 @@
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 preferencesConnectionModule = connection_container_module_1.ConnectionContainerModule.create(({ bind, bindBackendService }) => {
24
+ bindBackendService(cli_preferences_1.CliPreferencesPath, cli_preferences_1.CliPreferences);
25
+ });
26
+ exports.default = new inversify_1.ContainerModule(bind => {
27
+ bind(preference_cli_contribution_1.PreferenceCliContribution).toSelf().inSingletonScope();
28
+ bind(cli_preferences_1.CliPreferences).toService(preference_cli_contribution_1.PreferenceCliContribution);
29
+ bind(cli_1.CliContribution).toService(preference_cli_contribution_1.PreferenceCliContribution);
30
+ bind(connection_container_module_1.ConnectionContainerModule).toConstantValue(preferencesConnectionModule);
31
+ });
32
+ //# sourceMappingURL=preference-backend-module.js.map
@@ -0,0 +1 @@
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;AAE/E,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,CAAC,CAAC,SAAS,CAAC,uDAAyB,CAAC,CAAC;IAE3D,IAAI,CAAC,uDAAyB,CAAC,CAAC,eAAe,CAAC,2BAA2B,CAAC,CAAC;AACjF,CAAC,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /// <reference types="yargs" />
2
+ import { Argv } from '@theia/core/shared/yargs';
3
+ import { CliContribution } from '@theia/core/lib/node/cli';
4
+ import { CliPreferences } from '../common/cli-preferences';
5
+ export declare class PreferenceCliContribution implements CliContribution, CliPreferences {
6
+ protected preferences: [string, unknown][];
7
+ configure(conf: Argv<{}>): void;
8
+ setArguments(args: Record<string, unknown>): void;
9
+ getPreferences(): Promise<[string, unknown][]>;
10
+ }
11
+ //# sourceMappingURL=preference-cli-contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preference-cli-contribution.d.ts","sourceRoot":"","sources":["../../src/node/preference-cli-contribution.ts"],"names":[],"mappings":";AAiBA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qBACa,yBAA0B,YAAW,eAAe,EAAE,cAAc;IAE7E,SAAS,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAM;IAEhD,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI;IAO/B,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAU3C,cAAc,IAAI,OAAO,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;CAIvD"}
@@ -0,0 +1,48 @@
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
+ exports.PreferenceCliContribution = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ let PreferenceCliContribution = class PreferenceCliContribution {
22
+ constructor() {
23
+ this.preferences = [];
24
+ }
25
+ configure(conf) {
26
+ conf.option('set-preference', {
27
+ nargs: 1,
28
+ desc: 'sets the specified preference'
29
+ });
30
+ }
31
+ setArguments(args) {
32
+ if (args.setPreference) {
33
+ const preferences = args.setPreference instanceof Array ? args.setPreference : [args.setPreference];
34
+ for (const preference of preferences) {
35
+ const firstEqualIndex = preference.indexOf('=');
36
+ this.preferences.push([preference.substring(0, firstEqualIndex), JSON.parse(preference.substring(firstEqualIndex + 1))]);
37
+ }
38
+ }
39
+ }
40
+ async getPreferences() {
41
+ return this.preferences;
42
+ }
43
+ };
44
+ exports.PreferenceCliContribution = PreferenceCliContribution;
45
+ exports.PreferenceCliContribution = PreferenceCliContribution = tslib_1.__decorate([
46
+ (0, inversify_1.injectable)()
47
+ ], PreferenceCliContribution);
48
+ //# sourceMappingURL=preference-cli-contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preference-cli-contribution.js","sourceRoot":"","sources":["../../src/node/preference-cli-contribution.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;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": "1.49.1",
3
+ "version": "1.50.1",
4
4
  "description": "Theia - Preferences Extension",
5
5
  "dependencies": {
6
- "@theia/core": "1.49.1",
7
- "@theia/editor": "1.49.1",
8
- "@theia/filesystem": "1.49.1",
9
- "@theia/monaco": "1.49.1",
6
+ "@theia/core": "1.50.1",
7
+ "@theia/editor": "1.50.1",
8
+ "@theia/filesystem": "1.50.1",
9
+ "@theia/monaco": "1.50.1",
10
10
  "@theia/monaco-editor-core": "1.83.101",
11
- "@theia/userstorage": "1.49.1",
12
- "@theia/workspace": "1.49.1",
11
+ "@theia/userstorage": "1.50.1",
12
+ "@theia/workspace": "1.50.1",
13
13
  "async-mutex": "^0.3.1",
14
14
  "fast-deep-equal": "^3.1.3",
15
15
  "jsonc-parser": "^2.2.0",
@@ -21,7 +21,8 @@
21
21
  },
22
22
  "theiaExtensions": [
23
23
  {
24
- "frontend": "lib/browser/preference-frontend-module"
24
+ "frontend": "lib/browser/preference-frontend-module",
25
+ "backend": "lib/node/preference-backend-module"
25
26
  }
26
27
  ],
27
28
  "keywords": [
@@ -49,10 +50,10 @@
49
50
  "watch": "theiaext watch"
50
51
  },
51
52
  "devDependencies": {
52
- "@theia/ext-scripts": "1.49.1"
53
+ "@theia/ext-scripts": "1.50.1"
53
54
  },
54
55
  "nyc": {
55
56
  "extends": "../../configs/nyc.json"
56
57
  },
57
- "gitHead": "5bab04a50e95f7515a4d276fce963bef0e89db28"
58
+ "gitHead": "ffefc7ac2c0f6c63256042b7710551304200e5e1"
58
59
  }
@@ -0,0 +1,38 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2024 Typefox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { inject, injectable } from '@theia/core/shared/inversify';
18
+ import { FrontendApplicationContribution } from '@theia/core/lib/browser';
19
+ import { CliPreferences } from '../common/cli-preferences';
20
+ import { PreferenceService, PreferenceScope } from '@theia/core/lib/browser/preferences/preference-service';
21
+
22
+ @injectable()
23
+ export class PreferenceFrontendContribution implements FrontendApplicationContribution {
24
+ @inject(CliPreferences)
25
+ protected readonly CliPreferences: CliPreferences;
26
+
27
+ @inject(PreferenceService)
28
+ protected readonly preferenceService: PreferenceService;
29
+
30
+ onStart(): void {
31
+ this.CliPreferences.getPreferences().then(async preferences => {
32
+ await this.preferenceService.ready;
33
+ for (const [key, value] of preferences) {
34
+ this.preferenceService.set(key, value, PreferenceScope.User);
35
+ }
36
+ });
37
+ }
38
+ }
@@ -17,7 +17,7 @@
17
17
  import '../../src/browser/style/index.css';
18
18
  import './preferences-monaco-contribution';
19
19
  import { ContainerModule, interfaces } from '@theia/core/shared/inversify';
20
- import { bindViewContribution, OpenHandler } from '@theia/core/lib/browser';
20
+ import { bindViewContribution, FrontendApplicationContribution, OpenHandler } from '@theia/core/lib/browser';
21
21
  import { TabBarToolbarContribution } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
22
22
  import { PreferenceTreeGenerator } from './util/preference-tree-generator';
23
23
  import { bindPreferenceProviders } from './preference-bindings';
@@ -29,6 +29,9 @@ import { PreferencesJsonSchemaContribution } from './preferences-json-schema-con
29
29
  import { MonacoJSONCEditor } from './monaco-jsonc-editor';
30
30
  import { PreferenceTransaction, PreferenceTransactionFactory, preferenceTransactionFactoryCreator } from './preference-transaction-manager';
31
31
  import { PreferenceOpenHandler } from './preference-open-handler';
32
+ import { CliPreferences, CliPreferencesPath } from '../common/cli-preferences';
33
+ import { ServiceConnectionProvider } from '@theia/core/lib/browser/messaging/service-connection-provider';
34
+ import { PreferenceFrontendContribution } from './preference-frontend-contribution';
32
35
 
33
36
  export function bindPreferences(bind: interfaces.Bind, unbind: interfaces.Unbind): void {
34
37
  bindPreferenceProviders(bind, unbind);
@@ -50,6 +53,10 @@ export function bindPreferences(bind: interfaces.Bind, unbind: interfaces.Unbind
50
53
  bind(MonacoJSONCEditor).toSelf().inSingletonScope();
51
54
  bind(PreferenceTransaction).toSelf();
52
55
  bind(PreferenceTransactionFactory).toFactory(preferenceTransactionFactoryCreator);
56
+
57
+ bind(CliPreferences).toDynamicValue(ctx => ServiceConnectionProvider.createProxy<CliPreferences>(ctx.container, CliPreferencesPath)).inSingletonScope();
58
+ bind(PreferenceFrontendContribution).toSelf().inSingletonScope();
59
+ bind(FrontendApplicationContribution).toService(PreferenceFrontendContribution);
53
60
  }
54
61
 
55
62
  export default new ContainerModule((bind, unbind, isBound, rebind) => {
@@ -0,0 +1,22 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2024 Typefox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ export const CliPreferences = Symbol('CliPreferences');
18
+ export const CliPreferencesPath = '/services/cli-preferences';
19
+
20
+ export interface CliPreferences {
21
+ getPreferences(): Promise<[string, unknown][]>;
22
+ }
@@ -0,0 +1,33 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2024 Typefox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { ContainerModule } from '@theia/core/shared/inversify';
18
+ import { CliContribution } from '@theia/core/lib/node/cli';
19
+ import { PreferenceCliContribution } from './preference-cli-contribution';
20
+ import { ConnectionContainerModule } from '@theia/core/lib/node/messaging/connection-container-module';
21
+ import { CliPreferences, CliPreferencesPath } from '../common/cli-preferences';
22
+
23
+ const preferencesConnectionModule = ConnectionContainerModule.create(({ bind, bindBackendService }) => {
24
+ bindBackendService(CliPreferencesPath, CliPreferences);
25
+ });
26
+
27
+ export default new ContainerModule(bind => {
28
+ bind(PreferenceCliContribution).toSelf().inSingletonScope();
29
+ bind(CliPreferences).toService(PreferenceCliContribution);
30
+ bind(CliContribution).toService(PreferenceCliContribution);
31
+
32
+ bind(ConnectionContainerModule).toConstantValue(preferencesConnectionModule);
33
+ });
@@ -0,0 +1,48 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2024 Typefox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { injectable } from '@theia/core/shared/inversify';
18
+ import { Argv } from '@theia/core/shared/yargs';
19
+ import { CliContribution } from '@theia/core/lib/node/cli';
20
+ import { CliPreferences } from '../common/cli-preferences';
21
+
22
+ @injectable()
23
+ export class PreferenceCliContribution implements CliContribution, CliPreferences {
24
+
25
+ protected preferences: [string, unknown][] = [];
26
+
27
+ configure(conf: Argv<{}>): void {
28
+ conf.option('set-preference', {
29
+ nargs: 1,
30
+ desc: 'sets the specified preference'
31
+ });
32
+ }
33
+
34
+ setArguments(args: Record<string, unknown>): void {
35
+ if (args.setPreference) {
36
+ const preferences: string[] = args.setPreference instanceof Array ? args.setPreference : [args.setPreference];
37
+ for (const preference of preferences) {
38
+ const firstEqualIndex = preference.indexOf('=');
39
+ this.preferences.push([preference.substring(0, firstEqualIndex), JSON.parse(preference.substring(firstEqualIndex + 1))]);
40
+ }
41
+ }
42
+ }
43
+
44
+ async getPreferences(): Promise<[string, unknown][]> {
45
+ return this.preferences;
46
+ }
47
+
48
+ }