@theia/vsx-registry 1.34.2 → 1.34.3

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 (73) hide show
  1. package/LICENSE +641 -641
  2. package/README.md +36 -36
  3. package/lib/browser/recommended-extensions/preference-provider-overrides.d.ts +17 -17
  4. package/lib/browser/recommended-extensions/preference-provider-overrides.js +95 -95
  5. package/lib/browser/recommended-extensions/recommended-extensions-json-schema.d.ts +14 -14
  6. package/lib/browser/recommended-extensions/recommended-extensions-json-schema.js +94 -94
  7. package/lib/browser/recommended-extensions/recommended-extensions-preference-contribution.d.ts +11 -11
  8. package/lib/browser/recommended-extensions/recommended-extensions-preference-contribution.js +59 -59
  9. package/lib/browser/vsx-extension-commands.d.ts +13 -13
  10. package/lib/browser/vsx-extension-commands.js +63 -63
  11. package/lib/browser/vsx-extension-editor-manager.d.ts +9 -9
  12. package/lib/browser/vsx-extension-editor-manager.js +49 -49
  13. package/lib/browser/vsx-extension-editor.d.ts +21 -21
  14. package/lib/browser/vsx-extension-editor.js +109 -109
  15. package/lib/browser/vsx-extension.d.ts +141 -141
  16. package/lib/browser/vsx-extension.js +581 -581
  17. package/lib/browser/vsx-extensions-contribution.d.ts +54 -54
  18. package/lib/browser/vsx-extensions-contribution.js +328 -328
  19. package/lib/browser/vsx-extensions-model.d.ts +67 -67
  20. package/lib/browser/vsx-extensions-model.js +368 -368
  21. package/lib/browser/vsx-extensions-search-bar.d.ts +14 -14
  22. package/lib/browser/vsx-extensions-search-bar.js +75 -75
  23. package/lib/browser/vsx-extensions-search-model.d.ts +21 -21
  24. package/lib/browser/vsx-extensions-search-model.js +70 -70
  25. package/lib/browser/vsx-extensions-source.d.ts +19 -19
  26. package/lib/browser/vsx-extensions-source.js +102 -102
  27. package/lib/browser/vsx-extensions-view-container.d.ts +49 -49
  28. package/lib/browser/vsx-extensions-view-container.js +179 -179
  29. package/lib/browser/vsx-extensions-widget.d.ts +29 -29
  30. package/lib/browser/vsx-extensions-widget.js +143 -143
  31. package/lib/browser/vsx-language-quick-pick-service.d.ts +13 -13
  32. package/lib/browser/vsx-language-quick-pick-service.js +103 -103
  33. package/lib/browser/vsx-registry-frontend-module.d.ts +4 -4
  34. package/lib/browser/vsx-registry-frontend-module.js +101 -101
  35. package/lib/common/ovsx-client-provider.d.ts +6 -6
  36. package/lib/common/ovsx-client-provider.js +28 -28
  37. package/lib/common/vsx-environment.d.ts +7 -7
  38. package/lib/common/vsx-environment.js +20 -20
  39. package/lib/common/vsx-extension-uri.d.ts +3 -3
  40. package/lib/common/vsx-extension-uri.js +20 -20
  41. package/lib/node/vsx-environment-impl.d.ts +10 -10
  42. package/lib/node/vsx-environment-impl.js +53 -53
  43. package/lib/node/vsx-extension-resolver.d.ts +17 -17
  44. package/lib/node/vsx-extension-resolver.js +137 -137
  45. package/lib/node/vsx-registry-backend-module.d.ts +3 -3
  46. package/lib/node/vsx-registry-backend-module.js +35 -35
  47. package/lib/package.spec.js +25 -25
  48. package/package.json +10 -10
  49. package/src/browser/recommended-extensions/preference-provider-overrides.ts +99 -99
  50. package/src/browser/recommended-extensions/recommended-extensions-json-schema.ts +74 -74
  51. package/src/browser/recommended-extensions/recommended-extensions-preference-contribution.ts +68 -68
  52. package/src/browser/style/extensions.svg +4 -4
  53. package/src/browser/style/index.css +354 -354
  54. package/src/browser/vsx-extension-commands.ts +63 -63
  55. package/src/browser/vsx-extension-editor-manager.ts +42 -42
  56. package/src/browser/vsx-extension-editor.tsx +96 -96
  57. package/src/browser/vsx-extension.tsx +662 -662
  58. package/src/browser/vsx-extensions-contribution.ts +315 -315
  59. package/src/browser/vsx-extensions-model.ts +366 -366
  60. package/src/browser/vsx-extensions-search-bar.tsx +69 -69
  61. package/src/browser/vsx-extensions-search-model.ts +61 -61
  62. package/src/browser/vsx-extensions-source.ts +83 -83
  63. package/src/browser/vsx-extensions-view-container.ts +179 -179
  64. package/src/browser/vsx-extensions-widget.tsx +138 -138
  65. package/src/browser/vsx-language-quick-pick-service.ts +97 -97
  66. package/src/browser/vsx-registry-frontend-module.ts +113 -113
  67. package/src/common/ovsx-client-provider.ts +30 -30
  68. package/src/common/vsx-environment.ts +24 -24
  69. package/src/common/vsx-extension-uri.ts +20 -20
  70. package/src/node/vsx-environment-impl.ts +41 -41
  71. package/src/node/vsx-extension-resolver.ts +111 -111
  72. package/src/node/vsx-registry-backend-module.ts +37 -37
  73. package/src/package.spec.ts +29 -29
@@ -1,97 +1,97 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2022 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 WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { LanguageQuickPickItem, LanguageQuickPickService } from '@theia/core/lib/browser/i18n/language-quick-pick-service';
18
- import { RequestContext, RequestService } from '@theia/core/shared/@theia/request';
19
- import { inject, injectable } from '@theia/core/shared/inversify';
20
- import { LanguageInfo } from '@theia/core/lib/common/i18n/localization';
21
- import { PluginPackage, PluginServer } from '@theia/plugin-ext';
22
- import { OVSXClientProvider } from '../common/ovsx-client-provider';
23
- import { VSXSearchEntry } from '@theia/ovsx-client';
24
- import { VSCodeExtensionUri } from '@theia/plugin-ext-vscode/lib/common/plugin-vscode-uri';
25
-
26
- @injectable()
27
- export class VSXLanguageQuickPickService extends LanguageQuickPickService {
28
-
29
- @inject(OVSXClientProvider)
30
- protected readonly clientProvider: OVSXClientProvider;
31
-
32
- @inject(RequestService)
33
- protected readonly requestService: RequestService;
34
-
35
- @inject(PluginServer)
36
- protected readonly pluginServer: PluginServer;
37
-
38
- protected override async getAvailableLanguages(): Promise<LanguageQuickPickItem[]> {
39
- const client = await this.clientProvider();
40
- const searchResult = await client.search({
41
- category: 'Language Packs',
42
- sortBy: 'downloadCount',
43
- sortOrder: 'desc',
44
- size: 20
45
- });
46
- if (searchResult.error) {
47
- throw new Error('Error while loading available languages: ' + searchResult.error);
48
- }
49
-
50
- const extensionLanguages = await Promise.all(
51
- searchResult.extensions.map(async extension => ({
52
- extension,
53
- languages: await this.loadExtensionLanguages(extension)
54
- }))
55
- );
56
-
57
- const languages = new Map<string, LanguageQuickPickItem>();
58
-
59
- for (const extension of extensionLanguages) {
60
- for (const localizationContribution of extension.languages) {
61
- if (!languages.has(localizationContribution.languageId)) {
62
- languages.set(localizationContribution.languageId, {
63
- ...this.createLanguageQuickPickItem(localizationContribution),
64
- execute: async () => {
65
- const extensionUri = VSCodeExtensionUri.toUri(extension.extension.name, extension.extension.namespace).toString();
66
- await this.pluginServer.deploy(extensionUri);
67
- }
68
- });
69
- }
70
- }
71
- }
72
- return Array.from(languages.values());
73
- }
74
-
75
- protected async loadExtensionLanguages(extension: VSXSearchEntry): Promise<LanguageInfo[]> {
76
- // When searching for extensions on ovsx, we don't receive the `manifest` property.
77
- // This property is only set when querying a specific extension.
78
- // To improve performance, we assume that a manifest exists at `/package.json`.
79
- const downloadUrl = extension.files.download;
80
- const parentUrl = downloadUrl.substring(0, downloadUrl.lastIndexOf('/'));
81
- const manifestUrl = parentUrl + '/package.json';
82
- try {
83
- const manifestRequest = await this.requestService.request({ url: manifestUrl });
84
- const manifestContent = RequestContext.asJson<PluginPackage>(manifestRequest);
85
- const localizations = manifestContent.contributes?.localizations ?? [];
86
- return localizations.map(e => ({
87
- languageId: e.languageId,
88
- languageName: e.languageName,
89
- localizedLanguageName: e.localizedLanguageName,
90
- languagePack: true
91
- }));
92
- } catch {
93
- // The `package.json` file might not actually exist, simply return an empty array
94
- return [];
95
- }
96
- }
97
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2022 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 WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { LanguageQuickPickItem, LanguageQuickPickService } from '@theia/core/lib/browser/i18n/language-quick-pick-service';
18
+ import { RequestContext, RequestService } from '@theia/core/shared/@theia/request';
19
+ import { inject, injectable } from '@theia/core/shared/inversify';
20
+ import { LanguageInfo } from '@theia/core/lib/common/i18n/localization';
21
+ import { PluginPackage, PluginServer } from '@theia/plugin-ext';
22
+ import { OVSXClientProvider } from '../common/ovsx-client-provider';
23
+ import { VSXSearchEntry } from '@theia/ovsx-client';
24
+ import { VSCodeExtensionUri } from '@theia/plugin-ext-vscode/lib/common/plugin-vscode-uri';
25
+
26
+ @injectable()
27
+ export class VSXLanguageQuickPickService extends LanguageQuickPickService {
28
+
29
+ @inject(OVSXClientProvider)
30
+ protected readonly clientProvider: OVSXClientProvider;
31
+
32
+ @inject(RequestService)
33
+ protected readonly requestService: RequestService;
34
+
35
+ @inject(PluginServer)
36
+ protected readonly pluginServer: PluginServer;
37
+
38
+ protected override async getAvailableLanguages(): Promise<LanguageQuickPickItem[]> {
39
+ const client = await this.clientProvider();
40
+ const searchResult = await client.search({
41
+ category: 'Language Packs',
42
+ sortBy: 'downloadCount',
43
+ sortOrder: 'desc',
44
+ size: 20
45
+ });
46
+ if (searchResult.error) {
47
+ throw new Error('Error while loading available languages: ' + searchResult.error);
48
+ }
49
+
50
+ const extensionLanguages = await Promise.all(
51
+ searchResult.extensions.map(async extension => ({
52
+ extension,
53
+ languages: await this.loadExtensionLanguages(extension)
54
+ }))
55
+ );
56
+
57
+ const languages = new Map<string, LanguageQuickPickItem>();
58
+
59
+ for (const extension of extensionLanguages) {
60
+ for (const localizationContribution of extension.languages) {
61
+ if (!languages.has(localizationContribution.languageId)) {
62
+ languages.set(localizationContribution.languageId, {
63
+ ...this.createLanguageQuickPickItem(localizationContribution),
64
+ execute: async () => {
65
+ const extensionUri = VSCodeExtensionUri.toUri(extension.extension.name, extension.extension.namespace).toString();
66
+ await this.pluginServer.deploy(extensionUri);
67
+ }
68
+ });
69
+ }
70
+ }
71
+ }
72
+ return Array.from(languages.values());
73
+ }
74
+
75
+ protected async loadExtensionLanguages(extension: VSXSearchEntry): Promise<LanguageInfo[]> {
76
+ // When searching for extensions on ovsx, we don't receive the `manifest` property.
77
+ // This property is only set when querying a specific extension.
78
+ // To improve performance, we assume that a manifest exists at `/package.json`.
79
+ const downloadUrl = extension.files.download;
80
+ const parentUrl = downloadUrl.substring(0, downloadUrl.lastIndexOf('/'));
81
+ const manifestUrl = parentUrl + '/package.json';
82
+ try {
83
+ const manifestRequest = await this.requestService.request({ url: manifestUrl });
84
+ const manifestContent = RequestContext.asJson<PluginPackage>(manifestRequest);
85
+ const localizations = manifestContent.contributes?.localizations ?? [];
86
+ return localizations.map(e => ({
87
+ languageId: e.languageId,
88
+ languageName: e.languageName,
89
+ localizedLanguageName: e.localizedLanguageName,
90
+ languagePack: true
91
+ }));
92
+ } catch {
93
+ // The `package.json` file might not actually exist, simply return an empty array
94
+ return [];
95
+ }
96
+ }
97
+ }
@@ -1,113 +1,113 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2020 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 WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import '../../src/browser/style/index.css';
18
-
19
- import { ContainerModule } from '@theia/core/shared/inversify';
20
- import {
21
- WidgetFactory, bindViewContribution, FrontendApplicationContribution, ViewContainerIdentifier, OpenHandler, WidgetManager, WebSocketConnectionProvider
22
- } from '@theia/core/lib/browser';
23
- import { VSXExtensionsViewContainer } from './vsx-extensions-view-container';
24
- import { VSXExtensionsContribution } from './vsx-extensions-contribution';
25
- import { VSXExtensionsSearchBar } from './vsx-extensions-search-bar';
26
- import { VSXExtensionsModel } from './vsx-extensions-model';
27
- import { ColorContribution } from '@theia/core/lib/browser/color-application-contribution';
28
- import { VSXExtensionsWidget, VSXExtensionsWidgetOptions } from './vsx-extensions-widget';
29
- import { VSXExtensionFactory, VSXExtension, VSXExtensionOptions } from './vsx-extension';
30
- import { VSXExtensionEditor } from './vsx-extension-editor';
31
- import { VSXExtensionEditorManager } from './vsx-extension-editor-manager';
32
- import { VSXExtensionsSourceOptions } from './vsx-extensions-source';
33
- import { VSXExtensionsSearchModel } from './vsx-extensions-search-model';
34
- import { bindExtensionPreferences } from './recommended-extensions/recommended-extensions-preference-contribution';
35
- import { bindPreferenceProviderOverrides } from './recommended-extensions/preference-provider-overrides';
36
- import { OVSXClientProvider, createOVSXClient } from '../common/ovsx-client-provider';
37
- import { VSXEnvironment, VSX_ENVIRONMENT_PATH } from '../common/vsx-environment';
38
- import { RequestService } from '@theia/core/shared/@theia/request';
39
- import { LanguageQuickPickService } from '@theia/core/lib/browser/i18n/language-quick-pick-service';
40
- import { VSXLanguageQuickPickService } from './vsx-language-quick-pick-service';
41
-
42
- export default new ContainerModule((bind, unbind, _, rebind) => {
43
- bind<OVSXClientProvider>(OVSXClientProvider).toDynamicValue(ctx => {
44
- const clientPromise = createOVSXClient(ctx.container.get(VSXEnvironment), ctx.container.get(RequestService));
45
- return () => clientPromise;
46
- }).inSingletonScope();
47
- bind(VSXEnvironment).toDynamicValue(
48
- ctx => WebSocketConnectionProvider.createProxy(ctx.container, VSX_ENVIRONMENT_PATH)
49
- ).inSingletonScope();
50
-
51
- bind(VSXExtension).toSelf();
52
- bind(VSXExtensionFactory).toFactory(ctx => (option: VSXExtensionOptions) => {
53
- const child = ctx.container.createChild();
54
- child.bind(VSXExtensionOptions).toConstantValue(option);
55
- return child.get(VSXExtension);
56
- });
57
- bind(VSXExtensionsModel).toSelf().inSingletonScope();
58
-
59
- bind(VSXExtensionEditor).toSelf();
60
- bind(WidgetFactory).toDynamicValue(ctx => ({
61
- id: VSXExtensionEditor.ID,
62
- createWidget: async (options: VSXExtensionOptions) => {
63
- const extension = await ctx.container.get(VSXExtensionsModel).resolve(options.id);
64
- const child = ctx.container.createChild();
65
- child.bind(VSXExtension).toConstantValue(extension);
66
- return child.get(VSXExtensionEditor);
67
- }
68
- })).inSingletonScope();
69
- bind(VSXExtensionEditorManager).toSelf().inSingletonScope();
70
- bind(OpenHandler).toService(VSXExtensionEditorManager);
71
-
72
- bind(WidgetFactory).toDynamicValue(({ container }) => ({
73
- id: VSXExtensionsWidget.ID,
74
- createWidget: async (options: VSXExtensionsWidgetOptions) => VSXExtensionsWidget.createWidget(container, options)
75
- })).inSingletonScope();
76
- bind(WidgetFactory).toDynamicValue(ctx => ({
77
- id: VSXExtensionsViewContainer.ID,
78
- createWidget: async () => {
79
- const child = ctx.container.createChild();
80
- child.bind(ViewContainerIdentifier).toConstantValue({
81
- id: VSXExtensionsViewContainer.ID,
82
- progressLocationId: 'extensions'
83
- });
84
- child.bind(VSXExtensionsViewContainer).toSelf();
85
- const viewContainer = child.get(VSXExtensionsViewContainer);
86
- const widgetManager = child.get(WidgetManager);
87
- for (const id of [
88
- VSXExtensionsSourceOptions.SEARCH_RESULT,
89
- VSXExtensionsSourceOptions.RECOMMENDED,
90
- VSXExtensionsSourceOptions.INSTALLED,
91
- VSXExtensionsSourceOptions.BUILT_IN,
92
- ]) {
93
- const widget = await widgetManager.getOrCreateWidget(VSXExtensionsWidget.ID, { id });
94
- viewContainer.addWidget(widget, {
95
- initiallyCollapsed: id === VSXExtensionsSourceOptions.BUILT_IN
96
- });
97
- }
98
- return viewContainer;
99
- }
100
- })).inSingletonScope();
101
-
102
- bind(VSXExtensionsSearchModel).toSelf().inSingletonScope();
103
- bind(VSXExtensionsSearchBar).toSelf().inSingletonScope();
104
-
105
- rebind(LanguageQuickPickService).to(VSXLanguageQuickPickService).inSingletonScope();
106
-
107
- bindViewContribution(bind, VSXExtensionsContribution);
108
- bind(FrontendApplicationContribution).toService(VSXExtensionsContribution);
109
- bind(ColorContribution).toService(VSXExtensionsContribution);
110
-
111
- bindExtensionPreferences(bind);
112
- bindPreferenceProviderOverrides(bind, unbind);
113
- });
1
+ // *****************************************************************************
2
+ // Copyright (C) 2020 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 WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import '../../src/browser/style/index.css';
18
+
19
+ import { ContainerModule } from '@theia/core/shared/inversify';
20
+ import {
21
+ WidgetFactory, bindViewContribution, FrontendApplicationContribution, ViewContainerIdentifier, OpenHandler, WidgetManager, WebSocketConnectionProvider
22
+ } from '@theia/core/lib/browser';
23
+ import { VSXExtensionsViewContainer } from './vsx-extensions-view-container';
24
+ import { VSXExtensionsContribution } from './vsx-extensions-contribution';
25
+ import { VSXExtensionsSearchBar } from './vsx-extensions-search-bar';
26
+ import { VSXExtensionsModel } from './vsx-extensions-model';
27
+ import { ColorContribution } from '@theia/core/lib/browser/color-application-contribution';
28
+ import { VSXExtensionsWidget, VSXExtensionsWidgetOptions } from './vsx-extensions-widget';
29
+ import { VSXExtensionFactory, VSXExtension, VSXExtensionOptions } from './vsx-extension';
30
+ import { VSXExtensionEditor } from './vsx-extension-editor';
31
+ import { VSXExtensionEditorManager } from './vsx-extension-editor-manager';
32
+ import { VSXExtensionsSourceOptions } from './vsx-extensions-source';
33
+ import { VSXExtensionsSearchModel } from './vsx-extensions-search-model';
34
+ import { bindExtensionPreferences } from './recommended-extensions/recommended-extensions-preference-contribution';
35
+ import { bindPreferenceProviderOverrides } from './recommended-extensions/preference-provider-overrides';
36
+ import { OVSXClientProvider, createOVSXClient } from '../common/ovsx-client-provider';
37
+ import { VSXEnvironment, VSX_ENVIRONMENT_PATH } from '../common/vsx-environment';
38
+ import { RequestService } from '@theia/core/shared/@theia/request';
39
+ import { LanguageQuickPickService } from '@theia/core/lib/browser/i18n/language-quick-pick-service';
40
+ import { VSXLanguageQuickPickService } from './vsx-language-quick-pick-service';
41
+
42
+ export default new ContainerModule((bind, unbind, _, rebind) => {
43
+ bind<OVSXClientProvider>(OVSXClientProvider).toDynamicValue(ctx => {
44
+ const clientPromise = createOVSXClient(ctx.container.get(VSXEnvironment), ctx.container.get(RequestService));
45
+ return () => clientPromise;
46
+ }).inSingletonScope();
47
+ bind(VSXEnvironment).toDynamicValue(
48
+ ctx => WebSocketConnectionProvider.createProxy(ctx.container, VSX_ENVIRONMENT_PATH)
49
+ ).inSingletonScope();
50
+
51
+ bind(VSXExtension).toSelf();
52
+ bind(VSXExtensionFactory).toFactory(ctx => (option: VSXExtensionOptions) => {
53
+ const child = ctx.container.createChild();
54
+ child.bind(VSXExtensionOptions).toConstantValue(option);
55
+ return child.get(VSXExtension);
56
+ });
57
+ bind(VSXExtensionsModel).toSelf().inSingletonScope();
58
+
59
+ bind(VSXExtensionEditor).toSelf();
60
+ bind(WidgetFactory).toDynamicValue(ctx => ({
61
+ id: VSXExtensionEditor.ID,
62
+ createWidget: async (options: VSXExtensionOptions) => {
63
+ const extension = await ctx.container.get(VSXExtensionsModel).resolve(options.id);
64
+ const child = ctx.container.createChild();
65
+ child.bind(VSXExtension).toConstantValue(extension);
66
+ return child.get(VSXExtensionEditor);
67
+ }
68
+ })).inSingletonScope();
69
+ bind(VSXExtensionEditorManager).toSelf().inSingletonScope();
70
+ bind(OpenHandler).toService(VSXExtensionEditorManager);
71
+
72
+ bind(WidgetFactory).toDynamicValue(({ container }) => ({
73
+ id: VSXExtensionsWidget.ID,
74
+ createWidget: async (options: VSXExtensionsWidgetOptions) => VSXExtensionsWidget.createWidget(container, options)
75
+ })).inSingletonScope();
76
+ bind(WidgetFactory).toDynamicValue(ctx => ({
77
+ id: VSXExtensionsViewContainer.ID,
78
+ createWidget: async () => {
79
+ const child = ctx.container.createChild();
80
+ child.bind(ViewContainerIdentifier).toConstantValue({
81
+ id: VSXExtensionsViewContainer.ID,
82
+ progressLocationId: 'extensions'
83
+ });
84
+ child.bind(VSXExtensionsViewContainer).toSelf();
85
+ const viewContainer = child.get(VSXExtensionsViewContainer);
86
+ const widgetManager = child.get(WidgetManager);
87
+ for (const id of [
88
+ VSXExtensionsSourceOptions.SEARCH_RESULT,
89
+ VSXExtensionsSourceOptions.RECOMMENDED,
90
+ VSXExtensionsSourceOptions.INSTALLED,
91
+ VSXExtensionsSourceOptions.BUILT_IN,
92
+ ]) {
93
+ const widget = await widgetManager.getOrCreateWidget(VSXExtensionsWidget.ID, { id });
94
+ viewContainer.addWidget(widget, {
95
+ initiallyCollapsed: id === VSXExtensionsSourceOptions.BUILT_IN
96
+ });
97
+ }
98
+ return viewContainer;
99
+ }
100
+ })).inSingletonScope();
101
+
102
+ bind(VSXExtensionsSearchModel).toSelf().inSingletonScope();
103
+ bind(VSXExtensionsSearchBar).toSelf().inSingletonScope();
104
+
105
+ rebind(LanguageQuickPickService).to(VSXLanguageQuickPickService).inSingletonScope();
106
+
107
+ bindViewContribution(bind, VSXExtensionsContribution);
108
+ bind(FrontendApplicationContribution).toService(VSXExtensionsContribution);
109
+ bind(ColorContribution).toService(VSXExtensionsContribution);
110
+
111
+ bindExtensionPreferences(bind);
112
+ bindPreferenceProviderOverrides(bind, unbind);
113
+ });
@@ -1,30 +1,30 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2021 Ericsson 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 WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { RequestService } from '@theia/core/shared/@theia/request';
18
- import { OVSXClient } from '@theia/ovsx-client';
19
- import { VSXEnvironment } from './vsx-environment';
20
-
21
- export const OVSXClientProvider = Symbol('OVSXClientProvider');
22
- export type OVSXClientProvider = () => Promise<OVSXClient>;
23
-
24
- export async function createOVSXClient(vsxEnvironment: VSXEnvironment, requestService: RequestService): Promise<OVSXClient> {
25
- const [apiVersion, apiUrl] = await Promise.all([
26
- vsxEnvironment.getVscodeApiVersion(),
27
- vsxEnvironment.getRegistryApiUri()
28
- ]);
29
- return new OVSXClient({ apiVersion, apiUrl: apiUrl.toString() }, requestService);
30
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2021 Ericsson 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 WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { RequestService } from '@theia/core/shared/@theia/request';
18
+ import { OVSXClient } from '@theia/ovsx-client';
19
+ import { VSXEnvironment } from './vsx-environment';
20
+
21
+ export const OVSXClientProvider = Symbol('OVSXClientProvider');
22
+ export type OVSXClientProvider = () => Promise<OVSXClient>;
23
+
24
+ export async function createOVSXClient(vsxEnvironment: VSXEnvironment, requestService: RequestService): Promise<OVSXClient> {
25
+ const [apiVersion, apiUrl] = await Promise.all([
26
+ vsxEnvironment.getVscodeApiVersion(),
27
+ vsxEnvironment.getRegistryApiUri()
28
+ ]);
29
+ return new OVSXClient({ apiVersion, apiUrl: apiUrl.toString() }, requestService);
30
+ }
@@ -1,24 +1,24 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2021 Ericsson 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 WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- export const VSX_ENVIRONMENT_PATH = '/services/vsx-environment';
18
-
19
- export const VSXEnvironment = Symbol('VSXEnvironment');
20
- export interface VSXEnvironment {
21
- getRegistryUri(): Promise<string>;
22
- getRegistryApiUri(): Promise<string>;
23
- getVscodeApiVersion(): Promise<string>;
24
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2021 Ericsson 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 WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ export const VSX_ENVIRONMENT_PATH = '/services/vsx-environment';
18
+
19
+ export const VSXEnvironment = Symbol('VSXEnvironment');
20
+ export interface VSXEnvironment {
21
+ getRegistryUri(): Promise<string>;
22
+ getRegistryApiUri(): Promise<string>;
23
+ getVscodeApiVersion(): Promise<string>;
24
+ }
@@ -1,20 +1,20 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2020 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 WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { VSCodeExtensionUri as VSXExtensionUri } from '@theia/plugin-ext-vscode/lib/common/plugin-vscode-uri';
18
- /** @deprecated since 1.25.0. Import `VSCodeExtensionUri from `plugin-ext-vscode` package instead. */
19
- export { VSXExtensionUri };
20
-
1
+ // *****************************************************************************
2
+ // Copyright (C) 2020 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 WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { VSCodeExtensionUri as VSXExtensionUri } from '@theia/plugin-ext-vscode/lib/common/plugin-vscode-uri';
18
+ /** @deprecated since 1.25.0. Import `VSCodeExtensionUri from `plugin-ext-vscode` package instead. */
19
+ export { VSXExtensionUri };
20
+