@theia/vsx-registry 1.45.1 → 1.46.0-next.72

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 (100) hide show
  1. package/README.md +45 -45
  2. package/lib/browser/recommended-extensions/preference-provider-overrides.d.ts +17 -17
  3. package/lib/browser/recommended-extensions/preference-provider-overrides.js +95 -95
  4. package/lib/browser/recommended-extensions/recommended-extensions-json-schema.d.ts +14 -14
  5. package/lib/browser/recommended-extensions/recommended-extensions-json-schema.js +94 -94
  6. package/lib/browser/recommended-extensions/recommended-extensions-preference-contribution.d.ts +11 -11
  7. package/lib/browser/recommended-extensions/recommended-extensions-preference-contribution.js +59 -59
  8. package/lib/browser/vsx-extension-commands.d.ts +14 -13
  9. package/lib/browser/vsx-extension-commands.d.ts.map +1 -1
  10. package/lib/browser/vsx-extension-commands.js +68 -63
  11. package/lib/browser/vsx-extension-commands.js.map +1 -1
  12. package/lib/browser/vsx-extension-editor-manager.d.ts +9 -9
  13. package/lib/browser/vsx-extension-editor-manager.js +49 -49
  14. package/lib/browser/vsx-extension-editor.d.ts +21 -21
  15. package/lib/browser/vsx-extension-editor.js +109 -109
  16. package/lib/browser/vsx-extension.d.ts +146 -143
  17. package/lib/browser/vsx-extension.d.ts.map +1 -1
  18. package/lib/browser/vsx-extension.js +616 -596
  19. package/lib/browser/vsx-extension.js.map +1 -1
  20. package/lib/browser/vsx-extensions-contribution.d.ts +70 -60
  21. package/lib/browser/vsx-extensions-contribution.d.ts.map +1 -1
  22. package/lib/browser/vsx-extensions-contribution.js +375 -344
  23. package/lib/browser/vsx-extensions-contribution.js.map +1 -1
  24. package/lib/browser/vsx-extensions-model.d.ts +75 -72
  25. package/lib/browser/vsx-extensions-model.d.ts.map +1 -1
  26. package/lib/browser/vsx-extensions-model.js +437 -391
  27. package/lib/browser/vsx-extensions-model.js.map +1 -1
  28. package/lib/browser/vsx-extensions-preferences.d.ts +12 -0
  29. package/lib/browser/vsx-extensions-preferences.d.ts.map +1 -0
  30. package/lib/browser/vsx-extensions-preferences.js +47 -0
  31. package/lib/browser/vsx-extensions-preferences.js.map +1 -0
  32. package/lib/browser/vsx-extensions-search-bar.d.ts +22 -14
  33. package/lib/browser/vsx-extensions-search-bar.d.ts.map +1 -1
  34. package/lib/browser/vsx-extensions-search-bar.js +106 -75
  35. package/lib/browser/vsx-extensions-search-bar.js.map +1 -1
  36. package/lib/browser/vsx-extensions-search-model.d.ts +21 -21
  37. package/lib/browser/vsx-extensions-search-model.js +70 -70
  38. package/lib/browser/vsx-extensions-source.d.ts +19 -19
  39. package/lib/browser/vsx-extensions-source.js +102 -102
  40. package/lib/browser/vsx-extensions-view-container.d.ts +49 -49
  41. package/lib/browser/vsx-extensions-view-container.js +179 -179
  42. package/lib/browser/vsx-extensions-widget.d.ts +35 -34
  43. package/lib/browser/vsx-extensions-widget.d.ts.map +1 -1
  44. package/lib/browser/vsx-extensions-widget.js +164 -156
  45. package/lib/browser/vsx-extensions-widget.js.map +1 -1
  46. package/lib/browser/vsx-language-quick-pick-service.d.ts +15 -15
  47. package/lib/browser/vsx-language-quick-pick-service.js +121 -121
  48. package/lib/browser/vsx-registry-frontend-module.d.ts +4 -4
  49. package/lib/browser/vsx-registry-frontend-module.d.ts.map +1 -1
  50. package/lib/browser/vsx-registry-frontend-module.js +99 -97
  51. package/lib/browser/vsx-registry-frontend-module.js.map +1 -1
  52. package/lib/common/index.d.ts +3 -3
  53. package/lib/common/index.js +25 -25
  54. package/lib/common/ovsx-client-provider.d.ts +13 -13
  55. package/lib/common/ovsx-client-provider.js +29 -29
  56. package/lib/common/vsx-environment.d.ts +9 -9
  57. package/lib/common/vsx-environment.js +20 -20
  58. package/lib/common/vsx-extension-uri.d.ts +3 -3
  59. package/lib/common/vsx-extension-uri.js +20 -20
  60. package/lib/common/vsx-registry-common-module.d.ts +3 -3
  61. package/lib/common/vsx-registry-common-module.js +57 -57
  62. package/lib/node/vsx-cli.d.ts +9 -9
  63. package/lib/node/vsx-cli.js +41 -41
  64. package/lib/node/vsx-environment-impl.d.ts +14 -14
  65. package/lib/node/vsx-environment-impl.js +61 -61
  66. package/lib/node/vsx-extension-resolver.d.ts +20 -20
  67. package/lib/node/vsx-extension-resolver.js +154 -154
  68. package/lib/node/vsx-registry-backend-module.d.ts +3 -3
  69. package/lib/node/vsx-registry-backend-module.js +35 -35
  70. package/lib/package.spec.js +25 -25
  71. package/package.json +12 -12
  72. package/src/browser/recommended-extensions/preference-provider-overrides.ts +99 -99
  73. package/src/browser/recommended-extensions/recommended-extensions-json-schema.ts +74 -74
  74. package/src/browser/recommended-extensions/recommended-extensions-preference-contribution.ts +68 -68
  75. package/src/browser/style/extensions.svg +4 -4
  76. package/src/browser/style/index.css +436 -373
  77. package/src/browser/vsx-extension-commands.ts +68 -63
  78. package/src/browser/vsx-extension-editor-manager.ts +42 -42
  79. package/src/browser/vsx-extension-editor.tsx +96 -96
  80. package/src/browser/vsx-extension.tsx +704 -675
  81. package/src/browser/vsx-extensions-contribution.ts +361 -327
  82. package/src/browser/vsx-extensions-model.ts +436 -389
  83. package/src/browser/vsx-extensions-preferences.ts +58 -0
  84. package/src/browser/vsx-extensions-search-bar.tsx +107 -69
  85. package/src/browser/vsx-extensions-search-model.ts +61 -61
  86. package/src/browser/vsx-extensions-source.ts +83 -83
  87. package/src/browser/vsx-extensions-view-container.ts +179 -179
  88. package/src/browser/vsx-extensions-widget.tsx +165 -156
  89. package/src/browser/vsx-language-quick-pick-service.ts +110 -110
  90. package/src/browser/vsx-registry-frontend-module.ts +108 -106
  91. package/src/common/index.ts +19 -19
  92. package/src/common/ovsx-client-provider.ts +35 -35
  93. package/src/common/vsx-environment.ts +27 -27
  94. package/src/common/vsx-extension-uri.ts +20 -20
  95. package/src/common/vsx-registry-common-module.ts +63 -63
  96. package/src/node/vsx-cli.ts +38 -38
  97. package/src/node/vsx-environment-impl.ts +50 -50
  98. package/src/node/vsx-extension-resolver.ts +125 -125
  99. package/src/node/vsx-registry-backend-module.ts +35 -35
  100. package/src/package.spec.ts +29 -29
@@ -1,99 +1,99 @@
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-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import {
18
- FolderPreferenceProvider,
19
- FolderPreferenceProviderFactory,
20
- FolderPreferenceProviderFolder,
21
- UserPreferenceProvider,
22
- UserPreferenceProviderFactory
23
- } from '@theia/preferences/lib/browser';
24
- import { Container, injectable, interfaces } from '@theia/core/shared/inversify';
25
- import { extensionsConfigurationSchema } from './recommended-extensions-json-schema';
26
- import {
27
- WorkspaceFilePreferenceProvider,
28
- WorkspaceFilePreferenceProviderFactory,
29
- WorkspaceFilePreferenceProviderOptions
30
- } from '@theia/preferences/lib/browser/workspace-file-preference-provider';
31
- import { bindFactory } from '@theia/preferences/lib/browser/preference-bindings';
32
- import { SectionPreferenceProviderSection, SectionPreferenceProviderUri } from '@theia/preferences/lib/browser/section-preference-provider';
33
-
34
- /**
35
- * The overrides in this file are required because the base preference providers assume that a
36
- * section name (extensions) will not be used as a prefix (extensions.ignoreRecommendations).
37
- */
38
-
39
- @injectable()
40
- export class FolderPreferenceProviderWithExtensions extends FolderPreferenceProvider {
41
- protected override getPath(preferenceName: string): string[] | undefined {
42
- const path = super.getPath(preferenceName);
43
- if (this.section !== 'extensions' || !path?.length) {
44
- return path;
45
- }
46
- const isExtensionsField = path[0] in extensionsConfigurationSchema.properties!;
47
- if (isExtensionsField) {
48
- return path;
49
- }
50
- return undefined;
51
- }
52
- }
53
-
54
- @injectable()
55
- export class UserPreferenceProviderWithExtensions extends UserPreferenceProvider {
56
- protected override getPath(preferenceName: string): string[] | undefined {
57
- const path = super.getPath(preferenceName);
58
- if (this.section !== 'extensions' || !path?.length) {
59
- return path;
60
- }
61
- const isExtensionsField = path[0] in extensionsConfigurationSchema.properties!;
62
- if (isExtensionsField) {
63
- return path;
64
- }
65
- return undefined;
66
- }
67
- }
68
-
69
- @injectable()
70
- export class WorkspaceFilePreferenceProviderWithExtensions extends WorkspaceFilePreferenceProvider {
71
- protected override belongsInSection(firstSegment: string, remainder: string): boolean {
72
- if (firstSegment === 'extensions') {
73
- return remainder in extensionsConfigurationSchema.properties!;
74
- }
75
- return this.configurations.isSectionName(firstSegment);
76
- }
77
- }
78
-
79
- export function bindPreferenceProviderOverrides(bind: interfaces.Bind, unbind: interfaces.Unbind): void {
80
- unbind(UserPreferenceProviderFactory);
81
- unbind(FolderPreferenceProviderFactory);
82
- unbind(WorkspaceFilePreferenceProviderFactory);
83
- bindFactory(bind, UserPreferenceProviderFactory, UserPreferenceProviderWithExtensions, SectionPreferenceProviderUri, SectionPreferenceProviderSection);
84
- bindFactory(
85
- bind,
86
- FolderPreferenceProviderFactory,
87
- FolderPreferenceProviderWithExtensions,
88
- SectionPreferenceProviderUri,
89
- SectionPreferenceProviderSection,
90
- FolderPreferenceProviderFolder,
91
- );
92
- bind(WorkspaceFilePreferenceProviderFactory).toFactory(ctx => (options: WorkspaceFilePreferenceProviderOptions) => {
93
- const child = new Container({ defaultScope: 'Singleton' });
94
- child.parent = ctx.container;
95
- child.bind(WorkspaceFilePreferenceProvider).to(WorkspaceFilePreferenceProviderWithExtensions);
96
- child.bind(WorkspaceFilePreferenceProviderOptions).toConstantValue(options);
97
- return child.get(WorkspaceFilePreferenceProvider);
98
- });
99
- }
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-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import {
18
+ FolderPreferenceProvider,
19
+ FolderPreferenceProviderFactory,
20
+ FolderPreferenceProviderFolder,
21
+ UserPreferenceProvider,
22
+ UserPreferenceProviderFactory
23
+ } from '@theia/preferences/lib/browser';
24
+ import { Container, injectable, interfaces } from '@theia/core/shared/inversify';
25
+ import { extensionsConfigurationSchema } from './recommended-extensions-json-schema';
26
+ import {
27
+ WorkspaceFilePreferenceProvider,
28
+ WorkspaceFilePreferenceProviderFactory,
29
+ WorkspaceFilePreferenceProviderOptions
30
+ } from '@theia/preferences/lib/browser/workspace-file-preference-provider';
31
+ import { bindFactory } from '@theia/preferences/lib/browser/preference-bindings';
32
+ import { SectionPreferenceProviderSection, SectionPreferenceProviderUri } from '@theia/preferences/lib/browser/section-preference-provider';
33
+
34
+ /**
35
+ * The overrides in this file are required because the base preference providers assume that a
36
+ * section name (extensions) will not be used as a prefix (extensions.ignoreRecommendations).
37
+ */
38
+
39
+ @injectable()
40
+ export class FolderPreferenceProviderWithExtensions extends FolderPreferenceProvider {
41
+ protected override getPath(preferenceName: string): string[] | undefined {
42
+ const path = super.getPath(preferenceName);
43
+ if (this.section !== 'extensions' || !path?.length) {
44
+ return path;
45
+ }
46
+ const isExtensionsField = path[0] in extensionsConfigurationSchema.properties!;
47
+ if (isExtensionsField) {
48
+ return path;
49
+ }
50
+ return undefined;
51
+ }
52
+ }
53
+
54
+ @injectable()
55
+ export class UserPreferenceProviderWithExtensions extends UserPreferenceProvider {
56
+ protected override getPath(preferenceName: string): string[] | undefined {
57
+ const path = super.getPath(preferenceName);
58
+ if (this.section !== 'extensions' || !path?.length) {
59
+ return path;
60
+ }
61
+ const isExtensionsField = path[0] in extensionsConfigurationSchema.properties!;
62
+ if (isExtensionsField) {
63
+ return path;
64
+ }
65
+ return undefined;
66
+ }
67
+ }
68
+
69
+ @injectable()
70
+ export class WorkspaceFilePreferenceProviderWithExtensions extends WorkspaceFilePreferenceProvider {
71
+ protected override belongsInSection(firstSegment: string, remainder: string): boolean {
72
+ if (firstSegment === 'extensions') {
73
+ return remainder in extensionsConfigurationSchema.properties!;
74
+ }
75
+ return this.configurations.isSectionName(firstSegment);
76
+ }
77
+ }
78
+
79
+ export function bindPreferenceProviderOverrides(bind: interfaces.Bind, unbind: interfaces.Unbind): void {
80
+ unbind(UserPreferenceProviderFactory);
81
+ unbind(FolderPreferenceProviderFactory);
82
+ unbind(WorkspaceFilePreferenceProviderFactory);
83
+ bindFactory(bind, UserPreferenceProviderFactory, UserPreferenceProviderWithExtensions, SectionPreferenceProviderUri, SectionPreferenceProviderSection);
84
+ bindFactory(
85
+ bind,
86
+ FolderPreferenceProviderFactory,
87
+ FolderPreferenceProviderWithExtensions,
88
+ SectionPreferenceProviderUri,
89
+ SectionPreferenceProviderSection,
90
+ FolderPreferenceProviderFolder,
91
+ );
92
+ bind(WorkspaceFilePreferenceProviderFactory).toFactory(ctx => (options: WorkspaceFilePreferenceProviderOptions) => {
93
+ const child = new Container({ defaultScope: 'Singleton' });
94
+ child.parent = ctx.container;
95
+ child.bind(WorkspaceFilePreferenceProvider).to(WorkspaceFilePreferenceProviderWithExtensions);
96
+ child.bind(WorkspaceFilePreferenceProviderOptions).toConstantValue(options);
97
+ return child.get(WorkspaceFilePreferenceProvider);
98
+ });
99
+ }
@@ -1,74 +1,74 @@
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-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
18
- import { InMemoryResources } from '@theia/core';
19
- import { JsonSchemaContribution, JsonSchemaRegisterContext } from '@theia/core/lib/browser/json-schema-store';
20
- import { IJSONSchema } from '@theia/core/lib/common/json-schema';
21
- import URI from '@theia/core/lib/common/uri';
22
- import { WorkspaceService } from '@theia/workspace/lib/browser';
23
-
24
- export const extensionsSchemaID = 'vscode://schemas/extensions';
25
- export const extensionsConfigurationSchema: IJSONSchema = {
26
- $id: extensionsSchemaID,
27
- default: { recommendations: [] },
28
- type: 'object',
29
-
30
- properties: {
31
- recommendations: {
32
- title: 'A list of extensions recommended for users of this workspace. Should use the form "<publisher>.<extension name>"',
33
- type: 'array',
34
- items: {
35
- type: 'string',
36
- pattern: '^\\w[\\w-]+\\.\\w[\\w-]+$',
37
- patternErrorMessage: "Expected format '${publisher}.${name}'. Example: 'eclipse.theia'."
38
- },
39
- default: [],
40
- },
41
- unwantedRecommendations: {
42
- title: 'A list of extensions recommended by default that should not be recommended to users of this workspace. Should use the form "<publisher>.<extension name>"',
43
- type: 'array',
44
- items: {
45
- type: 'string',
46
- pattern: '^\\w[\\w-]+\\.\\w[\\w-]+$',
47
- patternErrorMessage: "Expected format '${publisher}.${name}'. Example: 'eclipse.theia'."
48
- },
49
- default: [],
50
- }
51
- },
52
- allowComments: true,
53
- allowTrailingCommas: true,
54
- };
55
-
56
- @injectable()
57
- export class ExtensionSchemaContribution implements JsonSchemaContribution {
58
- protected readonly uri = new URI(extensionsSchemaID);
59
- @inject(InMemoryResources) protected readonly inmemoryResources: InMemoryResources;
60
- @inject(WorkspaceService) protected readonly workspaceService: WorkspaceService;
61
-
62
- @postConstruct()
63
- protected init(): void {
64
- this.inmemoryResources.add(this.uri, JSON.stringify(extensionsConfigurationSchema));
65
- }
66
-
67
- registerSchemas(context: JsonSchemaRegisterContext): void {
68
- context.registerSchema({
69
- fileMatch: ['extensions.json'],
70
- url: this.uri.toString(),
71
- });
72
- this.workspaceService.updateSchema('extensions', { $ref: this.uri.toString() });
73
- }
74
- }
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-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
18
+ import { InMemoryResources } from '@theia/core';
19
+ import { JsonSchemaContribution, JsonSchemaRegisterContext } from '@theia/core/lib/browser/json-schema-store';
20
+ import { IJSONSchema } from '@theia/core/lib/common/json-schema';
21
+ import URI from '@theia/core/lib/common/uri';
22
+ import { WorkspaceService } from '@theia/workspace/lib/browser';
23
+
24
+ export const extensionsSchemaID = 'vscode://schemas/extensions';
25
+ export const extensionsConfigurationSchema: IJSONSchema = {
26
+ $id: extensionsSchemaID,
27
+ default: { recommendations: [] },
28
+ type: 'object',
29
+
30
+ properties: {
31
+ recommendations: {
32
+ title: 'A list of extensions recommended for users of this workspace. Should use the form "<publisher>.<extension name>"',
33
+ type: 'array',
34
+ items: {
35
+ type: 'string',
36
+ pattern: '^\\w[\\w-]+\\.\\w[\\w-]+$',
37
+ patternErrorMessage: "Expected format '${publisher}.${name}'. Example: 'eclipse.theia'."
38
+ },
39
+ default: [],
40
+ },
41
+ unwantedRecommendations: {
42
+ title: 'A list of extensions recommended by default that should not be recommended to users of this workspace. Should use the form "<publisher>.<extension name>"',
43
+ type: 'array',
44
+ items: {
45
+ type: 'string',
46
+ pattern: '^\\w[\\w-]+\\.\\w[\\w-]+$',
47
+ patternErrorMessage: "Expected format '${publisher}.${name}'. Example: 'eclipse.theia'."
48
+ },
49
+ default: [],
50
+ }
51
+ },
52
+ allowComments: true,
53
+ allowTrailingCommas: true,
54
+ };
55
+
56
+ @injectable()
57
+ export class ExtensionSchemaContribution implements JsonSchemaContribution {
58
+ protected readonly uri = new URI(extensionsSchemaID);
59
+ @inject(InMemoryResources) protected readonly inmemoryResources: InMemoryResources;
60
+ @inject(WorkspaceService) protected readonly workspaceService: WorkspaceService;
61
+
62
+ @postConstruct()
63
+ protected init(): void {
64
+ this.inmemoryResources.add(this.uri, JSON.stringify(extensionsConfigurationSchema));
65
+ }
66
+
67
+ registerSchemas(context: JsonSchemaRegisterContext): void {
68
+ context.registerSchema({
69
+ fileMatch: ['extensions.json'],
70
+ url: this.uri.toString(),
71
+ });
72
+ this.workspaceService.updateSchema('extensions', { $ref: this.uri.toString() });
73
+ }
74
+ }
@@ -1,68 +1,68 @@
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-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { createPreferenceProxy, PreferenceContribution, PreferenceSchema, PreferenceScope, PreferenceService } from '@theia/core/lib/browser';
18
- import { JsonSchemaContribution } from '@theia/core/lib/browser/json-schema-store';
19
- import { nls } from '@theia/core/lib/common/nls';
20
- import { PreferenceConfiguration } from '@theia/core/lib/browser/preferences/preference-configurations';
21
- import { interfaces } from '@theia/core/shared/inversify';
22
- import { ExtensionSchemaContribution, extensionsSchemaID } from './recommended-extensions-json-schema';
23
-
24
- export interface RecommendedExtensions {
25
- recommendations?: string[];
26
- unwantedRecommendations?: string[];
27
- }
28
-
29
- export const recommendedExtensionsPreferencesSchema: PreferenceSchema = {
30
- type: 'object',
31
- scope: PreferenceScope.Folder,
32
- properties: {
33
- extensions: {
34
- $ref: extensionsSchemaID,
35
- description: nls.localize('theia/vsx-registry/recommendedExtensions', 'A list of the names of extensions recommended for use in this workspace.'),
36
- defaultValue: { recommendations: [] },
37
- },
38
- },
39
- };
40
-
41
- export const IGNORE_RECOMMENDATIONS_ID = 'extensions.ignoreRecommendations';
42
-
43
- export const recommendedExtensionNotificationPreferencesSchema: PreferenceSchema = {
44
- type: 'object',
45
- scope: PreferenceScope.Folder,
46
- properties: {
47
- [IGNORE_RECOMMENDATIONS_ID]: {
48
- description: nls.localize('theia/vsx-registry/showRecommendedExtensions', 'Controls whether notifications are shown for extension recommendations.'),
49
- default: false,
50
- type: 'boolean'
51
- }
52
- }
53
- };
54
-
55
- export const ExtensionNotificationPreferences = Symbol('ExtensionNotificationPreferences');
56
-
57
- export function bindExtensionPreferences(bind: interfaces.Bind): void {
58
- bind(ExtensionSchemaContribution).toSelf().inSingletonScope();
59
- bind(JsonSchemaContribution).toService(ExtensionSchemaContribution);
60
- bind(PreferenceContribution).toConstantValue({ schema: recommendedExtensionsPreferencesSchema });
61
- bind(PreferenceConfiguration).toConstantValue({ name: 'extensions' });
62
-
63
- bind(ExtensionNotificationPreferences).toDynamicValue(({ container }) => {
64
- const preferenceService = container.get<PreferenceService>(PreferenceService);
65
- return createPreferenceProxy(preferenceService, recommendedExtensionNotificationPreferencesSchema);
66
- }).inSingletonScope();
67
- bind(PreferenceContribution).toConstantValue({ schema: recommendedExtensionNotificationPreferencesSchema });
68
- }
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-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { createPreferenceProxy, PreferenceContribution, PreferenceSchema, PreferenceScope, PreferenceService } from '@theia/core/lib/browser';
18
+ import { JsonSchemaContribution } from '@theia/core/lib/browser/json-schema-store';
19
+ import { nls } from '@theia/core/lib/common/nls';
20
+ import { PreferenceConfiguration } from '@theia/core/lib/browser/preferences/preference-configurations';
21
+ import { interfaces } from '@theia/core/shared/inversify';
22
+ import { ExtensionSchemaContribution, extensionsSchemaID } from './recommended-extensions-json-schema';
23
+
24
+ export interface RecommendedExtensions {
25
+ recommendations?: string[];
26
+ unwantedRecommendations?: string[];
27
+ }
28
+
29
+ export const recommendedExtensionsPreferencesSchema: PreferenceSchema = {
30
+ type: 'object',
31
+ scope: PreferenceScope.Folder,
32
+ properties: {
33
+ extensions: {
34
+ $ref: extensionsSchemaID,
35
+ description: nls.localize('theia/vsx-registry/recommendedExtensions', 'A list of the names of extensions recommended for use in this workspace.'),
36
+ defaultValue: { recommendations: [] },
37
+ },
38
+ },
39
+ };
40
+
41
+ export const IGNORE_RECOMMENDATIONS_ID = 'extensions.ignoreRecommendations';
42
+
43
+ export const recommendedExtensionNotificationPreferencesSchema: PreferenceSchema = {
44
+ type: 'object',
45
+ scope: PreferenceScope.Folder,
46
+ properties: {
47
+ [IGNORE_RECOMMENDATIONS_ID]: {
48
+ description: nls.localize('theia/vsx-registry/showRecommendedExtensions', 'Controls whether notifications are shown for extension recommendations.'),
49
+ default: false,
50
+ type: 'boolean'
51
+ }
52
+ }
53
+ };
54
+
55
+ export const ExtensionNotificationPreferences = Symbol('ExtensionNotificationPreferences');
56
+
57
+ export function bindExtensionPreferences(bind: interfaces.Bind): void {
58
+ bind(ExtensionSchemaContribution).toSelf().inSingletonScope();
59
+ bind(JsonSchemaContribution).toService(ExtensionSchemaContribution);
60
+ bind(PreferenceContribution).toConstantValue({ schema: recommendedExtensionsPreferencesSchema });
61
+ bind(PreferenceConfiguration).toConstantValue({ name: 'extensions' });
62
+
63
+ bind(ExtensionNotificationPreferences).toDynamicValue(({ container }) => {
64
+ const preferenceService = container.get<PreferenceService>(PreferenceService);
65
+ return createPreferenceProxy(preferenceService, recommendedExtensionNotificationPreferencesSchema);
66
+ }).inSingletonScope();
67
+ bind(PreferenceContribution).toConstantValue({ schema: recommendedExtensionNotificationPreferencesSchema });
68
+ }
@@ -1,4 +1,4 @@
1
- <!--Copyright (c) Microsoft Corporation. All rights reserved.-->
2
- <!--Copyright (C) 2019 TypeFox and others.-->
3
- <!--Licensed under the MIT License. See License.txt in the project root for license information.-->
4
- <svg fill="#F6F6F6" height="28" viewBox="0 0 28 28" width="28" xmlns="http://www.w3.org/2000/svg"><g fill="#F6F6F6"><path clip-rule="evenodd" d="m3 3h10v4h-6v6 2 6h6v4h-10zm18 12v6h-6v4h10v-10zm4-2v-10h-10v4h3v-1h4v4h-1v3z" fill-rule="evenodd"/><path d="m9 9h10v10h-10z"/></g></svg>
1
+ <!--Copyright (c) Microsoft Corporation. All rights reserved.-->
2
+ <!--Copyright (C) 2019 TypeFox and others.-->
3
+ <!--Licensed under the MIT License. See License.txt in the project root for license information.-->
4
+ <svg fill="#F6F6F6" height="28" viewBox="0 0 28 28" width="28" xmlns="http://www.w3.org/2000/svg"><g fill="#F6F6F6"><path clip-rule="evenodd" d="m3 3h10v4h-6v6 2 6h6v4h-10zm18 12v6h-6v4h10v-10zm4-2v-10h-10v4h3v-1h4v4h-1v3z" fill-rule="evenodd"/><path d="m9 9h10v10h-10z"/></g></svg>