@theia/plugin-ext 1.75.0-next.8 → 1.76.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/lib/common/errors.d.ts +1 -14
  2. package/lib/common/errors.d.ts.map +1 -1
  3. package/lib/common/errors.js +3 -16
  4. package/lib/common/errors.js.map +1 -1
  5. package/lib/common/plugin-api-rpc.d.ts +1 -1
  6. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  7. package/lib/common/plugin-protocol.d.ts +53 -648
  8. package/lib/common/plugin-protocol.d.ts.map +1 -1
  9. package/lib/common/plugin-protocol.js +11 -34
  10. package/lib/common/plugin-protocol.js.map +1 -1
  11. package/lib/hosted/browser/hosted-plugin.d.ts +2 -1
  12. package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
  13. package/lib/hosted/browser/hosted-plugin.js +8 -3
  14. package/lib/hosted/browser/hosted-plugin.js.map +1 -1
  15. package/lib/hosted/browser/worker/plugin-manifest-loader.d.ts.map +1 -1
  16. package/lib/hosted/browser/worker/plugin-manifest-loader.js +5 -36
  17. package/lib/hosted/browser/worker/plugin-manifest-loader.js.map +1 -1
  18. package/lib/hosted/browser/worker/worker-main.js +2 -1
  19. package/lib/hosted/browser/worker/worker-main.js.map +1 -1
  20. package/lib/hosted/common/hosted-plugin.js +10 -9
  21. package/lib/hosted/common/hosted-plugin.js.map +1 -1
  22. package/lib/hosted/common/hosted-plugin.spec.js +2 -0
  23. package/lib/hosted/common/hosted-plugin.spec.js.map +1 -1
  24. package/lib/hosted/node/hosted-plugin-localization-service.d.ts.map +1 -1
  25. package/lib/hosted/node/hosted-plugin-localization-service.js +4 -68
  26. package/lib/hosted/node/hosted-plugin-localization-service.js.map +1 -1
  27. package/lib/hosted/node/hosted-plugin-process.js +1 -0
  28. package/lib/hosted/node/hosted-plugin-process.js.map +1 -1
  29. package/lib/hosted/node/hosted-plugin.js +1 -0
  30. package/lib/hosted/node/hosted-plugin.js.map +1 -1
  31. package/lib/hosted/node/plugin-host-rpc.d.ts.map +1 -1
  32. package/lib/hosted/node/plugin-host-rpc.js +4 -2
  33. package/lib/hosted/node/plugin-host-rpc.js.map +1 -1
  34. package/lib/hosted/node/plugin-reader.d.ts.map +1 -1
  35. package/lib/hosted/node/plugin-reader.js +6 -4
  36. package/lib/hosted/node/plugin-reader.js.map +1 -1
  37. package/lib/hosted/node/plugin-service.js +1 -0
  38. package/lib/hosted/node/plugin-service.js.map +1 -1
  39. package/lib/hosted/node/scanners/grammars-reader.d.ts +3 -2
  40. package/lib/hosted/node/scanners/grammars-reader.d.ts.map +1 -1
  41. package/lib/hosted/node/scanners/grammars-reader.js +5 -23
  42. package/lib/hosted/node/scanners/grammars-reader.js.map +1 -1
  43. package/lib/hosted/node/scanners/scanner-theia.d.ts +38 -71
  44. package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
  45. package/lib/hosted/node/scanners/scanner-theia.js +117 -768
  46. package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
  47. package/lib/hosted/node/scanners/scanner-theia.spec.js +191 -0
  48. package/lib/hosted/node/scanners/scanner-theia.spec.js.map +1 -1
  49. package/lib/main/browser/comments/comment-thread-widget.d.ts +1 -1
  50. package/lib/main/browser/comments/comment-thread-widget.d.ts.map +1 -1
  51. package/lib/main/browser/comments/comment-thread-widget.js +46 -84
  52. package/lib/main/browser/comments/comment-thread-widget.js.map +1 -1
  53. package/lib/main/browser/comments/comments-service.d.ts +2 -0
  54. package/lib/main/browser/comments/comments-service.d.ts.map +1 -1
  55. package/lib/main/browser/comments/comments-service.js +7 -1
  56. package/lib/main/browser/comments/comments-service.js.map +1 -1
  57. package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts +2 -1
  58. package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts.map +1 -1
  59. package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js +6 -1
  60. package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js.map +1 -1
  61. package/lib/main/browser/debug/plugin-debug-session-contribution-registry.d.ts +2 -0
  62. package/lib/main/browser/debug/plugin-debug-session-contribution-registry.d.ts.map +1 -1
  63. package/lib/main/browser/debug/plugin-debug-session-contribution-registry.js +7 -1
  64. package/lib/main/browser/debug/plugin-debug-session-contribution-registry.js.map +1 -1
  65. package/lib/main/browser/menus/menus-contribution-handler.d.ts +2 -1
  66. package/lib/main/browser/menus/menus-contribution-handler.d.ts.map +1 -1
  67. package/lib/main/browser/menus/menus-contribution-handler.js +9 -4
  68. package/lib/main/browser/menus/menus-contribution-handler.js.map +1 -1
  69. package/lib/main/browser/notebooks/renderers/cell-output-webview.js +2 -21
  70. package/lib/main/browser/notebooks/renderers/cell-output-webview.js.map +1 -1
  71. package/lib/main/browser/plugin-contribution-handler.js +1 -1
  72. package/lib/main/browser/plugin-contribution-handler.js.map +1 -1
  73. package/lib/main/browser/plugin-ext-widget.js +10 -20
  74. package/lib/main/browser/plugin-ext-widget.js.map +1 -1
  75. package/lib/main/browser/plugin-icon-service.d.ts.map +1 -1
  76. package/lib/main/browser/plugin-icon-service.js +2 -1
  77. package/lib/main/browser/plugin-icon-service.js.map +1 -1
  78. package/lib/main/browser/plugin-icon-theme-service.d.ts.map +1 -1
  79. package/lib/main/browser/plugin-icon-theme-service.js +2 -1
  80. package/lib/main/browser/plugin-icon-theme-service.js.map +1 -1
  81. package/lib/main/browser/plugin-shared-style.d.ts.map +1 -1
  82. package/lib/main/browser/plugin-shared-style.js +2 -1
  83. package/lib/main/browser/plugin-shared-style.js.map +1 -1
  84. package/lib/main/browser/scm-main.d.ts.map +1 -1
  85. package/lib/main/browser/scm-main.js +3 -1
  86. package/lib/main/browser/scm-main.js.map +1 -1
  87. package/lib/main/browser/text-editor-model-service.d.ts +2 -1
  88. package/lib/main/browser/text-editor-model-service.d.ts.map +1 -1
  89. package/lib/main/browser/text-editor-model-service.js +6 -1
  90. package/lib/main/browser/text-editor-model-service.js.map +1 -1
  91. package/lib/main/browser/view/plugin-view-registry.d.ts +2 -0
  92. package/lib/main/browser/view/plugin-view-registry.d.ts.map +1 -1
  93. package/lib/main/browser/view/plugin-view-registry.js +14 -9
  94. package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
  95. package/lib/main/browser/view/tree-view-widget.d.ts +3 -0
  96. package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
  97. package/lib/main/browser/view/tree-view-widget.js +28 -18
  98. package/lib/main/browser/view/tree-view-widget.js.map +1 -1
  99. package/lib/main/browser/webview/webview.d.ts.map +1 -1
  100. package/lib/main/browser/webview/webview.js +4 -2
  101. package/lib/main/browser/webview/webview.js.map +1 -1
  102. package/lib/main/browser/webview-views/webview-views-main.d.ts.map +1 -1
  103. package/lib/main/browser/webview-views/webview-views-main.js +3 -2
  104. package/lib/main/browser/webview-views/webview-views-main.js.map +1 -1
  105. package/lib/main/browser/webviews-main.d.ts +8 -1
  106. package/lib/main/browser/webviews-main.d.ts.map +1 -1
  107. package/lib/main/browser/webviews-main.js +22 -18
  108. package/lib/main/browser/webviews-main.js.map +1 -1
  109. package/lib/main/browser/webviews-main.spec.d.ts +2 -0
  110. package/lib/main/browser/webviews-main.spec.d.ts.map +1 -0
  111. package/lib/main/browser/webviews-main.spec.js +132 -0
  112. package/lib/main/browser/webviews-main.spec.js.map +1 -0
  113. package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts +2 -1
  114. package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts.map +1 -1
  115. package/lib/main/node/handlers/plugin-theia-directory-handler.js +10 -4
  116. package/lib/main/node/handlers/plugin-theia-directory-handler.js.map +1 -1
  117. package/lib/main/node/handlers/plugin-theia-file-handler.d.ts +2 -0
  118. package/lib/main/node/handlers/plugin-theia-file-handler.d.ts.map +1 -1
  119. package/lib/main/node/handlers/plugin-theia-file-handler.js +9 -3
  120. package/lib/main/node/handlers/plugin-theia-file-handler.js.map +1 -1
  121. package/lib/main/node/paths/plugin-paths-service.js +1 -0
  122. package/lib/main/node/paths/plugin-paths-service.js.map +1 -1
  123. package/lib/main/node/plugin-deployer-contribution.js +1 -0
  124. package/lib/main/node/plugin-deployer-contribution.js.map +1 -1
  125. package/lib/main/node/plugin-deployer-impl.d.ts.map +1 -1
  126. package/lib/main/node/plugin-deployer-impl.js +16 -13
  127. package/lib/main/node/plugin-deployer-impl.js.map +1 -1
  128. package/lib/main/node/plugin-service.d.ts +2 -0
  129. package/lib/main/node/plugin-service.d.ts.map +1 -1
  130. package/lib/main/node/plugin-service.js +7 -1
  131. package/lib/main/node/plugin-service.js.map +1 -1
  132. package/lib/main/node/plugin-uninstallation-manager.d.ts +2 -1
  133. package/lib/main/node/plugin-uninstallation-manager.d.ts.map +1 -1
  134. package/lib/main/node/plugin-uninstallation-manager.js +6 -1
  135. package/lib/main/node/plugin-uninstallation-manager.js.map +1 -1
  136. package/lib/main/node/plugins-key-value-storage.d.ts +2 -0
  137. package/lib/main/node/plugins-key-value-storage.d.ts.map +1 -1
  138. package/lib/main/node/plugins-key-value-storage.js +9 -3
  139. package/lib/main/node/plugins-key-value-storage.js.map +1 -1
  140. package/lib/main/node/resolvers/local-plugin-deployer-resolver.d.ts +2 -0
  141. package/lib/main/node/resolvers/local-plugin-deployer-resolver.d.ts.map +1 -1
  142. package/lib/main/node/resolvers/local-plugin-deployer-resolver.js +7 -1
  143. package/lib/main/node/resolvers/local-plugin-deployer-resolver.js.map +1 -1
  144. package/lib/main/node/webview-backend-security-warnings.d.ts +2 -0
  145. package/lib/main/node/webview-backend-security-warnings.d.ts.map +1 -1
  146. package/lib/main/node/webview-backend-security-warnings.js +7 -1
  147. package/lib/main/node/webview-backend-security-warnings.js.map +1 -1
  148. package/lib/plugin/scm.js +1 -1
  149. package/lib/plugin/scm.js.map +1 -1
  150. package/package.json +32 -31
  151. package/src/common/errors.ts +1 -25
  152. package/src/common/plugin-api-rpc.ts +1 -1
  153. package/src/common/plugin-protocol.ts +203 -662
  154. package/src/hosted/browser/hosted-plugin.ts +8 -5
  155. package/src/hosted/browser/worker/plugin-manifest-loader.ts +8 -41
  156. package/src/hosted/browser/worker/worker-main.ts +2 -1
  157. package/src/hosted/common/hosted-plugin.spec.ts +2 -0
  158. package/src/hosted/common/hosted-plugin.ts +10 -10
  159. package/src/hosted/node/hosted-plugin-localization-service.ts +3 -82
  160. package/src/hosted/node/hosted-plugin-process.ts +1 -1
  161. package/src/hosted/node/hosted-plugin.ts +2 -2
  162. package/src/hosted/node/plugin-host-rpc.ts +6 -3
  163. package/src/hosted/node/plugin-reader.ts +7 -6
  164. package/src/hosted/node/plugin-service.ts +1 -1
  165. package/src/hosted/node/scanners/grammars-reader.ts +14 -23
  166. package/src/hosted/node/scanners/scanner-theia.spec.ts +225 -1
  167. package/src/hosted/node/scanners/scanner-theia.ts +204 -881
  168. package/src/main/browser/comments/comments-service.ts +6 -2
  169. package/src/main/browser/custom-editors/plugin-custom-editor-registry.ts +6 -3
  170. package/src/main/browser/debug/plugin-debug-session-contribution-registry.ts +5 -1
  171. package/src/main/browser/menus/menus-contribution-handler.ts +9 -6
  172. package/src/main/browser/plugin-contribution-handler.ts +1 -1
  173. package/src/main/browser/plugin-icon-service.ts +2 -1
  174. package/src/main/browser/plugin-icon-theme-service.ts +2 -1
  175. package/src/main/browser/plugin-shared-style.ts +2 -1
  176. package/src/main/browser/scm-main.ts +3 -1
  177. package/src/main/browser/text-editor-model-service.ts +6 -3
  178. package/src/main/browser/view/plugin-view-registry.ts +14 -11
  179. package/src/main/browser/view/tree-view-widget.tsx +14 -7
  180. package/src/main/browser/webview/webview.ts +4 -2
  181. package/src/main/browser/webview-views/webview-views-main.ts +4 -4
  182. package/src/main/browser/webviews-main.spec.ts +160 -0
  183. package/src/main/browser/webviews-main.ts +22 -19
  184. package/src/main/node/handlers/plugin-theia-directory-handler.ts +9 -6
  185. package/src/main/node/handlers/plugin-theia-file-handler.ts +8 -5
  186. package/src/main/node/paths/plugin-paths-service.ts +2 -2
  187. package/src/main/node/plugin-deployer-contribution.ts +2 -2
  188. package/src/main/node/plugin-deployer-impl.ts +20 -14
  189. package/src/main/node/plugin-service.ts +6 -2
  190. package/src/main/node/plugin-uninstallation-manager.ts +7 -4
  191. package/src/main/node/plugins-key-value-storage.ts +8 -4
  192. package/src/main/node/resolvers/local-plugin-deployer-resolver.ts +7 -2
  193. package/src/main/node/webview-backend-security-warnings.ts +6 -2
  194. package/src/plugin/scm.ts +1 -1
  195. package/lib/hosted/node/plugin-activation-events.d.ts +0 -7
  196. package/lib/hosted/node/plugin-activation-events.d.ts.map +0 -1
  197. package/lib/hosted/node/plugin-activation-events.js +0 -95
  198. package/lib/hosted/node/plugin-activation-events.js.map +0 -1
  199. package/lib/hosted/node/plugin-manifest-loader.d.ts +0 -3
  200. package/lib/hosted/node/plugin-manifest-loader.d.ts.map +0 -1
  201. package/lib/hosted/node/plugin-manifest-loader.js +0 -34
  202. package/lib/hosted/node/plugin-manifest-loader.js.map +0 -1
  203. package/lib/main/node/errors.spec.d.ts +0 -2
  204. package/lib/main/node/errors.spec.d.ts.map +0 -1
  205. package/lib/main/node/errors.spec.js +0 -36
  206. package/lib/main/node/errors.spec.js.map +0 -1
  207. package/src/hosted/node/plugin-activation-events.ts +0 -112
  208. package/src/hosted/node/plugin-manifest-loader.ts +0 -32
  209. package/src/main/node/errors.spec.ts +0 -37
@@ -1,36 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2023 Arduino SA 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 assert_1 = require("assert");
19
- const strict_1 = require("assert/strict");
20
- const fs_1 = require("fs");
21
- const uuid_1 = require("@theia/core/lib/common/uuid");
22
- const errors_1 = require("../../common/errors");
23
- describe('errors', () => {
24
- describe('errno-exception', () => {
25
- it('should be ENOENT error', async () => {
26
- await (0, assert_1.rejects)(fs_1.promises.readFile((0, uuid_1.generateUuid)()), reason => (0, errors_1.isENOENT)(reason));
27
- });
28
- it('should not be ENOENT error (no code)', () => {
29
- (0, strict_1.strictEqual)((0, errors_1.isENOENT)(new Error('I am not ENOENT')), false);
30
- });
31
- it('should not be ENOENT error (other code)', async () => {
32
- await (0, assert_1.rejects)(fs_1.promises.readdir(__filename), reason => !(0, errors_1.isENOENT)(reason));
33
- });
34
- });
35
- });
36
- //# sourceMappingURL=errors.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.spec.js","sourceRoot":"","sources":["../../../src/main/node/errors.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,4CAA4C;AAC5C,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,mCAAiC;AACjC,0CAA4C;AAC5C,2BAAoC;AACpC,sDAA2D;AAC3D,gDAA+C;AAE/C,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACpB,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;QAC7B,EAAE,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE;YACpC,MAAM,IAAA,gBAAO,EAAC,aAAE,CAAC,QAAQ,CAAC,IAAA,mBAAY,GAAE,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,IAAA,iBAAQ,EAAC,MAAM,CAAC,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;YAC5C,IAAA,oBAAW,EAAC,IAAA,iBAAQ,EAAC,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;YACrD,MAAM,IAAA,gBAAO,EAAC,aAAE,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,IAAA,iBAAQ,EAAC,MAAM,CAAC,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,112 +0,0 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2023 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 { flatten } from '../../common/arrays';
18
- import { isStringArray, isObject } from '@theia/core/lib/common/types';
19
- import {
20
- PluginPackage,
21
- PluginPackageAuthenticationProvider,
22
- PluginPackageCommand,
23
- PluginPackageContribution,
24
- PluginPackageCustomEditor,
25
- PluginPackageLanguageContribution,
26
- PluginPackageNotebook,
27
- PluginPackageView
28
- } from '../../common/plugin-protocol';
29
-
30
- /**
31
- * Most activation events can be automatically deduced from the package manifest.
32
- * This function will update the manifest based on the plugin contributions.
33
- */
34
- export function updateActivationEvents(manifest: PluginPackage): void {
35
- if (!isObject<PluginPackage>(manifest) || !isObject<PluginPackageContribution>(manifest.contributes) || !manifest.contributes) {
36
- return;
37
- }
38
-
39
- const activationEvents = new Set(isStringArray(manifest.activationEvents) ? manifest.activationEvents : []);
40
-
41
- if (manifest.contributes.commands) {
42
- const value = manifest.contributes.commands;
43
- const commands = Array.isArray(value) ? value : [value];
44
- updateCommandsContributions(commands, activationEvents);
45
- }
46
- if (isObject(manifest.contributes.views)) {
47
- const views = flatten(Object.values(manifest.contributes.views));
48
- updateViewsContribution(views, activationEvents);
49
- }
50
- if (Array.isArray(manifest.contributes.customEditors)) {
51
- updateCustomEditorsContribution(manifest.contributes.customEditors, activationEvents);
52
- }
53
- if (Array.isArray(manifest.contributes.authentication)) {
54
- updateAuthenticationProviderContributions(manifest.contributes.authentication, activationEvents);
55
- }
56
- if (Array.isArray(manifest.contributes.languages)) {
57
- updateLanguageContributions(manifest.contributes.languages, activationEvents);
58
- }
59
- if (Array.isArray(manifest.contributes.notebooks)) {
60
- updateNotebookContributions(manifest.contributes.notebooks, activationEvents);
61
- }
62
-
63
- manifest.activationEvents = Array.from(activationEvents);
64
- }
65
-
66
- function updateViewsContribution(views: PluginPackageView[], activationEvents: Set<string>): void {
67
- for (const view of views) {
68
- if (isObject<PluginPackageView>(view) && typeof view.id === 'string') {
69
- activationEvents.add(`onView:${view.id}`);
70
- }
71
- }
72
- }
73
-
74
- function updateCustomEditorsContribution(customEditors: PluginPackageCustomEditor[], activationEvents: Set<string>): void {
75
- for (const customEditor of customEditors) {
76
- if (isObject<PluginPackageCustomEditor>(customEditor) && typeof customEditor.viewType === 'string') {
77
- activationEvents.add(`onCustomEditor:${customEditor.viewType}`);
78
- }
79
- }
80
- }
81
-
82
- function updateCommandsContributions(commands: PluginPackageCommand[], activationEvents: Set<string>): void {
83
- for (const command of commands) {
84
- if (isObject<PluginPackageCommand>(command) && typeof command.command === 'string') {
85
- activationEvents.add(`onCommand:${command.command}`);
86
- }
87
- }
88
- }
89
-
90
- function updateAuthenticationProviderContributions(authProviders: PluginPackageAuthenticationProvider[], activationEvents: Set<string>): void {
91
- for (const authProvider of authProviders) {
92
- if (isObject<PluginPackageAuthenticationProvider>(authProvider) && typeof authProvider.id === 'string') {
93
- activationEvents.add(`onAuthenticationRequest:${authProvider.id}`);
94
- }
95
- }
96
- }
97
-
98
- function updateLanguageContributions(languages: PluginPackageLanguageContribution[], activationEvents: Set<string>): void {
99
- for (const language of languages) {
100
- if (isObject<PluginPackageLanguageContribution>(language) && typeof language.id === 'string') {
101
- activationEvents.add(`onLanguage:${language.id}`);
102
- }
103
- }
104
- }
105
-
106
- function updateNotebookContributions(notebooks: PluginPackageNotebook[], activationEvents: Set<string>): void {
107
- for (const notebook of notebooks) {
108
- if (isObject<PluginPackageNotebook>(notebook) && typeof notebook.type === 'string') {
109
- activationEvents.add(`onNotebookSerializer:${notebook.type}`);
110
- }
111
- }
112
- }
@@ -1,32 +0,0 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2018 Red Hat, Inc. 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 * as path from 'path';
18
- import * as fs from '@theia/core/shared/fs-extra';
19
- import { PluginIdentifiers, PluginPackage } from '../../common';
20
- import { updateActivationEvents } from './plugin-activation-events';
21
-
22
- export async function loadManifest(pluginPath: string): Promise<PluginPackage> {
23
- const manifest = await fs.readJson(path.join(pluginPath, 'package.json'));
24
- // translate vscode builtins, as they are published with a prefix. See https://github.com/theia-ide/vscode-builtin-extensions/blob/master/src/republish.js#L50
25
- const built_prefix = '@theia/vscode-builtin-';
26
- if (manifest && manifest.name && manifest.name.startsWith(built_prefix)) {
27
- manifest.name = manifest.name.substring(built_prefix.length);
28
- }
29
- manifest.publisher ??= PluginIdentifiers.UNPUBLISHED;
30
- updateActivationEvents(manifest);
31
- return manifest;
32
- }
@@ -1,37 +0,0 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2023 Arduino SA 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 { rejects } from 'assert';
18
- import { strictEqual } from 'assert/strict';
19
- import { promises as fs } from 'fs';
20
- import { generateUuid } from '@theia/core/lib/common/uuid';
21
- import { isENOENT } from '../../common/errors';
22
-
23
- describe('errors', () => {
24
- describe('errno-exception', () => {
25
- it('should be ENOENT error', async () => {
26
- await rejects(fs.readFile(generateUuid()), reason => isENOENT(reason));
27
- });
28
-
29
- it('should not be ENOENT error (no code)', () => {
30
- strictEqual(isENOENT(new Error('I am not ENOENT')), false);
31
- });
32
-
33
- it('should not be ENOENT error (other code)', async () => {
34
- await rejects(fs.readdir(__filename), reason => !isENOENT(reason));
35
- });
36
- });
37
- });