@theia/vsx-registry 1.53.0-next.55 → 1.53.0-next.64
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.
- package/README.md +45 -45
- package/package.json +10 -10
- package/src/browser/recommended-extensions/preference-provider-overrides.ts +99 -99
- package/src/browser/recommended-extensions/recommended-extensions-json-schema.ts +74 -74
- package/src/browser/recommended-extensions/recommended-extensions-preference-contribution.ts +68 -68
- package/src/browser/style/extensions.svg +4 -4
- package/src/browser/style/index.css +436 -436
- package/src/browser/vsx-extension-argument-processor.ts +32 -32
- package/src/browser/vsx-extension-commands.ts +68 -68
- package/src/browser/vsx-extension-editor-manager.ts +42 -42
- package/src/browser/vsx-extension-editor.tsx +96 -96
- package/src/browser/vsx-extension.tsx +710 -710
- package/src/browser/vsx-extensions-contribution.ts +373 -373
- package/src/browser/vsx-extensions-model.ts +456 -456
- package/src/browser/vsx-extensions-preferences.ts +58 -58
- package/src/browser/vsx-extensions-search-bar.tsx +107 -107
- package/src/browser/vsx-extensions-search-model.ts +61 -61
- package/src/browser/vsx-extensions-source.ts +83 -83
- package/src/browser/vsx-extensions-view-container.ts +179 -179
- package/src/browser/vsx-extensions-widget.tsx +165 -165
- package/src/browser/vsx-language-quick-pick-service.ts +112 -112
- package/src/browser/vsx-registry-frontend-module.ts +113 -113
- package/src/common/index.ts +19 -19
- package/src/common/ovsx-client-provider.ts +35 -35
- package/src/common/vsx-environment.ts +28 -28
- package/src/common/vsx-extension-uri.ts +20 -20
- package/src/common/vsx-registry-common-module.ts +85 -85
- package/src/node/vsx-cli-deployer-participant.ts +46 -46
- package/src/node/vsx-cli.ts +55 -55
- package/src/node/vsx-environment-impl.ts +54 -54
- package/src/node/vsx-extension-resolver.ts +134 -134
- package/src/node/vsx-registry-backend-module.ts +38 -38
- package/src/node/vsx-remote-cli.ts +39 -39
- package/src/package.spec.ts +29 -29
package/README.md
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
<div align='center'>
|
|
2
|
-
|
|
3
|
-
<br />
|
|
4
|
-
|
|
5
|
-
<img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
|
|
6
|
-
|
|
7
|
-
<h2>ECLIPSE THEIA - Open VSX Registry Extension</h2>
|
|
8
|
-
|
|
9
|
-
<hr />
|
|
10
|
-
|
|
11
|
-
</div>
|
|
12
|
-
|
|
13
|
-
## Description
|
|
14
|
-
|
|
15
|
-
The `@theia/vsx-registry` extension provides integration with the Open VSX Registry.
|
|
16
|
-
|
|
17
|
-
### Configuration
|
|
18
|
-
|
|
19
|
-
The extension connects to the public Open VSX Registry hosted on `http://open-vsx.org/`.
|
|
20
|
-
One can host own instance of a [registry](https://github.com/eclipse/openvsx#eclipse-open-vsx)
|
|
21
|
-
and configure `VSX_REGISTRY_URL` environment variable to use it.
|
|
22
|
-
|
|
23
|
-
### Using multiple registries
|
|
24
|
-
|
|
25
|
-
It is possible to target multiple registries by specifying a CLI argument when
|
|
26
|
-
running the backend: `--ovsx-router-config=<path>` where `path` must point to
|
|
27
|
-
a json defining an `OVSXRouterConfig` object.
|
|
28
|
-
|
|
29
|
-
See `@theia/ovsx-client`'s documentation to read more about `OVSXRouterClient`
|
|
30
|
-
and its `OVSXRouterConfig` configuration.
|
|
31
|
-
|
|
32
|
-
## Additional Information
|
|
33
|
-
|
|
34
|
-
- [API documentation for `@theia/vsx-registry`](https://eclipse-theia.github.io/theia/docs/next/modules/vsx-registry.html)
|
|
35
|
-
- [Theia - GitHub](https://github.com/eclipse-theia/theia)
|
|
36
|
-
- [Theia - Website](https://theia-ide.org/)
|
|
37
|
-
|
|
38
|
-
## License
|
|
39
|
-
|
|
40
|
-
- [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
|
|
41
|
-
- [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
|
|
42
|
-
|
|
43
|
-
## Trademark
|
|
44
|
-
"Theia" is a trademark of the Eclipse Foundation
|
|
45
|
-
https://www.eclipse.org/theia
|
|
1
|
+
<div align='center'>
|
|
2
|
+
|
|
3
|
+
<br />
|
|
4
|
+
|
|
5
|
+
<img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
|
|
6
|
+
|
|
7
|
+
<h2>ECLIPSE THEIA - Open VSX Registry Extension</h2>
|
|
8
|
+
|
|
9
|
+
<hr />
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
## Description
|
|
14
|
+
|
|
15
|
+
The `@theia/vsx-registry` extension provides integration with the Open VSX Registry.
|
|
16
|
+
|
|
17
|
+
### Configuration
|
|
18
|
+
|
|
19
|
+
The extension connects to the public Open VSX Registry hosted on `http://open-vsx.org/`.
|
|
20
|
+
One can host own instance of a [registry](https://github.com/eclipse/openvsx#eclipse-open-vsx)
|
|
21
|
+
and configure `VSX_REGISTRY_URL` environment variable to use it.
|
|
22
|
+
|
|
23
|
+
### Using multiple registries
|
|
24
|
+
|
|
25
|
+
It is possible to target multiple registries by specifying a CLI argument when
|
|
26
|
+
running the backend: `--ovsx-router-config=<path>` where `path` must point to
|
|
27
|
+
a json defining an `OVSXRouterConfig` object.
|
|
28
|
+
|
|
29
|
+
See `@theia/ovsx-client`'s documentation to read more about `OVSXRouterClient`
|
|
30
|
+
and its `OVSXRouterConfig` configuration.
|
|
31
|
+
|
|
32
|
+
## Additional Information
|
|
33
|
+
|
|
34
|
+
- [API documentation for `@theia/vsx-registry`](https://eclipse-theia.github.io/theia/docs/next/modules/vsx-registry.html)
|
|
35
|
+
- [Theia - GitHub](https://github.com/eclipse-theia/theia)
|
|
36
|
+
- [Theia - Website](https://theia-ide.org/)
|
|
37
|
+
|
|
38
|
+
## License
|
|
39
|
+
|
|
40
|
+
- [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
|
|
41
|
+
- [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
|
|
42
|
+
|
|
43
|
+
## Trademark
|
|
44
|
+
"Theia" is a trademark of the Eclipse Foundation
|
|
45
|
+
https://www.eclipse.org/theia
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/vsx-registry",
|
|
3
|
-
"version": "1.53.0-next.
|
|
3
|
+
"version": "1.53.0-next.64+23b351d26",
|
|
4
4
|
"description": "Theia - VSX Registry",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.53.0-next.
|
|
7
|
-
"@theia/filesystem": "1.53.0-next.
|
|
8
|
-
"@theia/navigator": "1.53.0-next.
|
|
9
|
-
"@theia/ovsx-client": "1.53.0-next.
|
|
10
|
-
"@theia/plugin-ext": "1.53.0-next.
|
|
11
|
-
"@theia/plugin-ext-vscode": "1.53.0-next.
|
|
12
|
-
"@theia/preferences": "1.53.0-next.
|
|
13
|
-
"@theia/workspace": "1.53.0-next.
|
|
6
|
+
"@theia/core": "1.53.0-next.64+23b351d26",
|
|
7
|
+
"@theia/filesystem": "1.53.0-next.64+23b351d26",
|
|
8
|
+
"@theia/navigator": "1.53.0-next.64+23b351d26",
|
|
9
|
+
"@theia/ovsx-client": "1.53.0-next.64+23b351d26",
|
|
10
|
+
"@theia/plugin-ext": "1.53.0-next.64+23b351d26",
|
|
11
|
+
"@theia/plugin-ext-vscode": "1.53.0-next.64+23b351d26",
|
|
12
|
+
"@theia/preferences": "1.53.0-next.64+23b351d26",
|
|
13
|
+
"@theia/workspace": "1.53.0-next.64+23b351d26",
|
|
14
14
|
"limiter": "^2.1.0",
|
|
15
15
|
"luxon": "^2.4.0",
|
|
16
16
|
"p-debounce": "^2.1.0",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"nyc": {
|
|
62
62
|
"extends": "../../configs/nyc.json"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "23b351d26346a2b5d6aca3ee81fba59c056132f7"
|
|
65
65
|
}
|
|
@@ -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
|
+
}
|
package/src/browser/recommended-extensions/recommended-extensions-preference-contribution.ts
CHANGED
|
@@ -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>
|