@theia/plugin-ext-vscode 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 +32 -32
- package/package.json +15 -15
- package/src/browser/plugin-vscode-commands-contribution.ts +987 -987
- package/src/browser/plugin-vscode-contribution.ts +47 -47
- package/src/browser/plugin-vscode-frontend-module.ts +30 -30
- package/src/common/plugin-vscode-environment.ts +59 -59
- package/src/common/plugin-vscode-types.ts +20 -20
- package/src/common/plugin-vscode-uri.ts +45 -45
- package/src/node/context/plugin-vscode-init-fe.ts +43 -43
- package/src/node/local-vsix-file-plugin-deployer-resolver.ts +51 -51
- package/src/node/package.spec.ts +28 -28
- package/src/node/plugin-vscode-backend-module.ts +46 -46
- package/src/node/plugin-vscode-cli-contribution.ts +64 -64
- package/src/node/plugin-vscode-deployer-participant.ts +48 -48
- package/src/node/plugin-vscode-directory-handler.ts +123 -123
- package/src/node/plugin-vscode-file-handler.ts +62 -62
- package/src/node/plugin-vscode-init.ts +80 -80
- package/src/node/plugin-vscode-utils.ts +101 -101
- package/src/node/scanner-vscode.ts +113 -113
|
@@ -1,47 +1,47 @@
|
|
|
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-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { injectable } from '@theia/core/shared/inversify';
|
|
18
|
-
import { UserStorageUri } from '@theia/userstorage/lib/browser/user-storage-uri';
|
|
19
|
-
import { FileServiceContribution, FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
20
|
-
import { Schemes } from '@theia/plugin-ext/lib/common/uri-components';
|
|
21
|
-
import { DelegatingFileSystemProvider } from '@theia/filesystem/lib/common/delegating-file-system-provider';
|
|
22
|
-
|
|
23
|
-
@injectable()
|
|
24
|
-
export class PluginVSCodeContribution implements FileServiceContribution {
|
|
25
|
-
|
|
26
|
-
registerFileSystemProviders(service: FileService): void {
|
|
27
|
-
this.mapSchemas(service, Schemes.vscodeRemote, 'file');
|
|
28
|
-
this.mapSchemas(service, Schemes.userData, UserStorageUri.scheme);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
protected mapSchemas(service: FileService, from: string, to: string): void {
|
|
32
|
-
service.onWillActivateFileSystemProvider(event => {
|
|
33
|
-
if (event.scheme === from) {
|
|
34
|
-
event.waitUntil((async () => {
|
|
35
|
-
const provider = await service.activateProvider(to);
|
|
36
|
-
service.registerProvider(from, new DelegatingFileSystemProvider(provider, {
|
|
37
|
-
uriConverter: {
|
|
38
|
-
to: resource => resource.withScheme(to),
|
|
39
|
-
from: resource => resource.withScheme(from)
|
|
40
|
-
}
|
|
41
|
-
}));
|
|
42
|
-
})());
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
}
|
|
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-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { injectable } from '@theia/core/shared/inversify';
|
|
18
|
+
import { UserStorageUri } from '@theia/userstorage/lib/browser/user-storage-uri';
|
|
19
|
+
import { FileServiceContribution, FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
20
|
+
import { Schemes } from '@theia/plugin-ext/lib/common/uri-components';
|
|
21
|
+
import { DelegatingFileSystemProvider } from '@theia/filesystem/lib/common/delegating-file-system-provider';
|
|
22
|
+
|
|
23
|
+
@injectable()
|
|
24
|
+
export class PluginVSCodeContribution implements FileServiceContribution {
|
|
25
|
+
|
|
26
|
+
registerFileSystemProviders(service: FileService): void {
|
|
27
|
+
this.mapSchemas(service, Schemes.vscodeRemote, 'file');
|
|
28
|
+
this.mapSchemas(service, Schemes.userData, UserStorageUri.scheme);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
protected mapSchemas(service: FileService, from: string, to: string): void {
|
|
32
|
+
service.onWillActivateFileSystemProvider(event => {
|
|
33
|
+
if (event.scheme === from) {
|
|
34
|
+
event.waitUntil((async () => {
|
|
35
|
+
const provider = await service.activateProvider(to);
|
|
36
|
+
service.registerProvider(from, new DelegatingFileSystemProvider(provider, {
|
|
37
|
+
uriConverter: {
|
|
38
|
+
to: resource => resource.withScheme(to),
|
|
39
|
+
from: resource => resource.withScheme(from)
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
42
|
+
})());
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2018 Red Hat, Inc. and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
18
|
-
import { CommandContribution } from '@theia/core';
|
|
19
|
-
import { PluginVscodeCommandsContribution } from './plugin-vscode-commands-contribution';
|
|
20
|
-
import { PluginVSCodeEnvironment } from '../common/plugin-vscode-environment';
|
|
21
|
-
import { PluginVSCodeContribution } from './plugin-vscode-contribution';
|
|
22
|
-
import { FileServiceContribution } from '@theia/filesystem/lib/browser/file-service';
|
|
23
|
-
|
|
24
|
-
export default new ContainerModule(bind => {
|
|
25
|
-
bind(PluginVSCodeEnvironment).toSelf().inSingletonScope();
|
|
26
|
-
bind(PluginVscodeCommandsContribution).toSelf().inSingletonScope();
|
|
27
|
-
bind(CommandContribution).toService(PluginVscodeCommandsContribution);
|
|
28
|
-
bind(PluginVSCodeContribution).toSelf().inSingletonScope();
|
|
29
|
-
bind(FileServiceContribution).toService(PluginVSCodeContribution);
|
|
30
|
-
});
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2018 Red Hat, Inc. and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
18
|
+
import { CommandContribution } from '@theia/core';
|
|
19
|
+
import { PluginVscodeCommandsContribution } from './plugin-vscode-commands-contribution';
|
|
20
|
+
import { PluginVSCodeEnvironment } from '../common/plugin-vscode-environment';
|
|
21
|
+
import { PluginVSCodeContribution } from './plugin-vscode-contribution';
|
|
22
|
+
import { FileServiceContribution } from '@theia/filesystem/lib/browser/file-service';
|
|
23
|
+
|
|
24
|
+
export default new ContainerModule(bind => {
|
|
25
|
+
bind(PluginVSCodeEnvironment).toSelf().inSingletonScope();
|
|
26
|
+
bind(PluginVscodeCommandsContribution).toSelf().inSingletonScope();
|
|
27
|
+
bind(CommandContribution).toService(PluginVscodeCommandsContribution);
|
|
28
|
+
bind(PluginVSCodeContribution).toSelf().inSingletonScope();
|
|
29
|
+
bind(FileServiceContribution).toService(PluginVSCodeContribution);
|
|
30
|
+
});
|
|
@@ -1,59 +1,59 @@
|
|
|
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-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
18
|
-
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
|
|
19
|
-
import URI from '@theia/core/lib/common/uri';
|
|
20
|
-
|
|
21
|
-
@injectable()
|
|
22
|
-
export class PluginVSCodeEnvironment {
|
|
23
|
-
|
|
24
|
-
@inject(EnvVariablesServer)
|
|
25
|
-
protected readonly environments: EnvVariablesServer;
|
|
26
|
-
|
|
27
|
-
protected _userExtensionsDirUri: URI | undefined;
|
|
28
|
-
protected _deployedPluginsUri: URI | undefined;
|
|
29
|
-
protected _tmpDirUri: URI | undefined;
|
|
30
|
-
|
|
31
|
-
async getUserExtensionsDirUri(): Promise<URI> {
|
|
32
|
-
if (!this._userExtensionsDirUri) {
|
|
33
|
-
const configDir = new URI(await this.environments.getConfigDirUri());
|
|
34
|
-
this._userExtensionsDirUri = configDir.resolve('extensions');
|
|
35
|
-
}
|
|
36
|
-
return this._userExtensionsDirUri;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
async getDeploymentDirUri(): Promise<URI> {
|
|
40
|
-
if (!this._deployedPluginsUri) {
|
|
41
|
-
const configDir = new URI(await this.environments.getConfigDirUri());
|
|
42
|
-
this._deployedPluginsUri = configDir.resolve('deployedPlugins');
|
|
43
|
-
}
|
|
44
|
-
return this._deployedPluginsUri;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
async getTempDirUri(prefix?: string): Promise<URI> {
|
|
48
|
-
if (!this._tmpDirUri) {
|
|
49
|
-
const configDir: URI = new URI(await this.environments.getConfigDirUri());
|
|
50
|
-
this._tmpDirUri = configDir.resolve('tmp');
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (prefix) {
|
|
54
|
-
return this._tmpDirUri.resolve(prefix);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return this._tmpDirUri;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
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-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
18
|
+
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
|
|
19
|
+
import URI from '@theia/core/lib/common/uri';
|
|
20
|
+
|
|
21
|
+
@injectable()
|
|
22
|
+
export class PluginVSCodeEnvironment {
|
|
23
|
+
|
|
24
|
+
@inject(EnvVariablesServer)
|
|
25
|
+
protected readonly environments: EnvVariablesServer;
|
|
26
|
+
|
|
27
|
+
protected _userExtensionsDirUri: URI | undefined;
|
|
28
|
+
protected _deployedPluginsUri: URI | undefined;
|
|
29
|
+
protected _tmpDirUri: URI | undefined;
|
|
30
|
+
|
|
31
|
+
async getUserExtensionsDirUri(): Promise<URI> {
|
|
32
|
+
if (!this._userExtensionsDirUri) {
|
|
33
|
+
const configDir = new URI(await this.environments.getConfigDirUri());
|
|
34
|
+
this._userExtensionsDirUri = configDir.resolve('extensions');
|
|
35
|
+
}
|
|
36
|
+
return this._userExtensionsDirUri;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async getDeploymentDirUri(): Promise<URI> {
|
|
40
|
+
if (!this._deployedPluginsUri) {
|
|
41
|
+
const configDir = new URI(await this.environments.getConfigDirUri());
|
|
42
|
+
this._deployedPluginsUri = configDir.resolve('deployedPlugins');
|
|
43
|
+
}
|
|
44
|
+
return this._deployedPluginsUri;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async getTempDirUri(prefix?: string): Promise<URI> {
|
|
48
|
+
if (!this._tmpDirUri) {
|
|
49
|
+
const configDir: URI = new URI(await this.environments.getConfigDirUri());
|
|
50
|
+
this._tmpDirUri = configDir.resolve('tmp');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (prefix) {
|
|
54
|
+
return this._tmpDirUri.resolve(prefix);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return this._tmpDirUri;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2020 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 { DEFAULT_SUPPORTED_API_VERSION } from '@theia/core/shared/@theia/application-package/lib/api';
|
|
18
|
-
|
|
19
|
-
export const VSCODE_DEFAULT_API_VERSION = DEFAULT_SUPPORTED_API_VERSION;
|
|
20
|
-
export const VSX_REGISTRY_URL_DEFAULT = 'https://open-vsx.org';
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2020 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 { DEFAULT_SUPPORTED_API_VERSION } from '@theia/core/shared/@theia/application-package/lib/api';
|
|
18
|
+
|
|
19
|
+
export const VSCODE_DEFAULT_API_VERSION = DEFAULT_SUPPORTED_API_VERSION;
|
|
20
|
+
export const VSX_REGISTRY_URL_DEFAULT = 'https://open-vsx.org';
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2022 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 URI from '@theia/core/lib/common/uri';
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Static methods for identifying a plugin as the target of the VSCode deployment system.
|
|
21
|
-
* In practice, this means that it will be resolved and deployed by the Open-VSX system.
|
|
22
|
-
*/
|
|
23
|
-
export namespace VSCodeExtensionUri {
|
|
24
|
-
export const SCHEME = 'vscode-extension';
|
|
25
|
-
|
|
26
|
-
export function fromId(id: string, version?: string): URI {
|
|
27
|
-
if (typeof version === 'string') {
|
|
28
|
-
return new URI().withScheme(VSCodeExtensionUri.SCHEME).withAuthority(id).withPath(`/${version}`);
|
|
29
|
-
} else {
|
|
30
|
-
return new URI().withScheme(VSCodeExtensionUri.SCHEME).withAuthority(id);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function fromVersionedId(versionedId: string): URI {
|
|
35
|
-
const versionAndId = versionedId.split('@');
|
|
36
|
-
return fromId(versionAndId[0], versionAndId[1]);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function toId(uri: URI): { id: string, version?: string } | undefined {
|
|
40
|
-
if (uri.scheme === VSCodeExtensionUri.SCHEME) {
|
|
41
|
-
return { id: uri.authority, version: uri.path.isRoot ? undefined : uri.path.base };
|
|
42
|
-
}
|
|
43
|
-
return undefined;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2022 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 URI from '@theia/core/lib/common/uri';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Static methods for identifying a plugin as the target of the VSCode deployment system.
|
|
21
|
+
* In practice, this means that it will be resolved and deployed by the Open-VSX system.
|
|
22
|
+
*/
|
|
23
|
+
export namespace VSCodeExtensionUri {
|
|
24
|
+
export const SCHEME = 'vscode-extension';
|
|
25
|
+
|
|
26
|
+
export function fromId(id: string, version?: string): URI {
|
|
27
|
+
if (typeof version === 'string') {
|
|
28
|
+
return new URI().withScheme(VSCodeExtensionUri.SCHEME).withAuthority(id).withPath(`/${version}`);
|
|
29
|
+
} else {
|
|
30
|
+
return new URI().withScheme(VSCodeExtensionUri.SCHEME).withAuthority(id);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function fromVersionedId(versionedId: string): URI {
|
|
35
|
+
const versionAndId = versionedId.split('@');
|
|
36
|
+
return fromId(versionAndId[0], versionAndId[1]);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function toId(uri: URI): { id: string, version?: string } | undefined {
|
|
40
|
+
if (uri.scheme === VSCodeExtensionUri.SCHEME) {
|
|
41
|
+
return { id: uri.authority, version: uri.path.isRoot ? undefined : uri.path.base };
|
|
42
|
+
}
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2022 Arm 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
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
-
const _scope = (this as any);
|
|
19
|
-
_scope.exports = {};
|
|
20
|
-
|
|
21
|
-
const _getModule = () => {
|
|
22
|
-
if (!_scope[_scope.frontendModuleName]) {
|
|
23
|
-
_scope[_scope.frontendModuleName] = {};
|
|
24
|
-
}
|
|
25
|
-
return _scope[_scope.frontendModuleName];
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
Object.defineProperty(_scope.exports, 'activate', {
|
|
29
|
-
set: value => _getModule().activate = value
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
Object.defineProperty(_scope.exports, 'deactivate', {
|
|
33
|
-
set: value => _getModule().deactivate = value
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
_scope.require = (moduleName: string) => {
|
|
37
|
-
const vscodeModuleName = 'vscode';
|
|
38
|
-
|
|
39
|
-
if (moduleName === vscodeModuleName) {
|
|
40
|
-
// Return the defaultApi
|
|
41
|
-
return _scope.theia._empty;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2022 Arm 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
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
+
const _scope = (this as any);
|
|
19
|
+
_scope.exports = {};
|
|
20
|
+
|
|
21
|
+
const _getModule = () => {
|
|
22
|
+
if (!_scope[_scope.frontendModuleName]) {
|
|
23
|
+
_scope[_scope.frontendModuleName] = {};
|
|
24
|
+
}
|
|
25
|
+
return _scope[_scope.frontendModuleName];
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
Object.defineProperty(_scope.exports, 'activate', {
|
|
29
|
+
set: value => _getModule().activate = value
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
Object.defineProperty(_scope.exports, 'deactivate', {
|
|
33
|
+
set: value => _getModule().deactivate = value
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
_scope.require = (moduleName: string) => {
|
|
37
|
+
const vscodeModuleName = 'vscode';
|
|
38
|
+
|
|
39
|
+
if (moduleName === vscodeModuleName) {
|
|
40
|
+
// Return the defaultApi
|
|
41
|
+
return _scope.theia._empty;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2018 Red Hat, Inc. and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import * as path from 'path';
|
|
18
|
-
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
19
|
-
import { PluginDeployerResolverContext } from '@theia/plugin-ext';
|
|
20
|
-
import { LocalPluginDeployerResolver } from '@theia/plugin-ext/lib/main/node/resolvers/local-plugin-deployer-resolver';
|
|
21
|
-
import { PluginVSCodeEnvironment } from '../common/plugin-vscode-environment';
|
|
22
|
-
import { isVSCodePluginFile } from './plugin-vscode-file-handler';
|
|
23
|
-
import { existsInDeploymentDir, unpackToDeploymentDir } from './plugin-vscode-utils';
|
|
24
|
-
|
|
25
|
-
@injectable()
|
|
26
|
-
export class LocalVSIXFilePluginDeployerResolver extends LocalPluginDeployerResolver {
|
|
27
|
-
static LOCAL_FILE = 'local-file';
|
|
28
|
-
static FILE_EXTENSION = '.vsix';
|
|
29
|
-
|
|
30
|
-
@inject(PluginVSCodeEnvironment) protected readonly environment: PluginVSCodeEnvironment;
|
|
31
|
-
|
|
32
|
-
protected get supportedScheme(): string {
|
|
33
|
-
return LocalVSIXFilePluginDeployerResolver.LOCAL_FILE;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
override accept(pluginId: string): boolean {
|
|
37
|
-
return super.accept(pluginId) && isVSCodePluginFile(pluginId);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
async resolveFromLocalPath(pluginResolverContext: PluginDeployerResolverContext, localPath: string): Promise<void> {
|
|
41
|
-
const extensionId = path.basename(localPath, LocalVSIXFilePluginDeployerResolver.FILE_EXTENSION);
|
|
42
|
-
|
|
43
|
-
if (await existsInDeploymentDir(this.environment, extensionId)) {
|
|
44
|
-
console.log(`[${pluginResolverContext.getOriginId()}]: Target dir already exists in plugin deployment dir`);
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const extensionDeploymentDir = await unpackToDeploymentDir(this.environment, localPath, extensionId);
|
|
49
|
-
pluginResolverContext.addPlugin(extensionId, extensionDeploymentDir);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2018 Red Hat, Inc. and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import * as path from 'path';
|
|
18
|
+
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
19
|
+
import { PluginDeployerResolverContext } from '@theia/plugin-ext';
|
|
20
|
+
import { LocalPluginDeployerResolver } from '@theia/plugin-ext/lib/main/node/resolvers/local-plugin-deployer-resolver';
|
|
21
|
+
import { PluginVSCodeEnvironment } from '../common/plugin-vscode-environment';
|
|
22
|
+
import { isVSCodePluginFile } from './plugin-vscode-file-handler';
|
|
23
|
+
import { existsInDeploymentDir, unpackToDeploymentDir } from './plugin-vscode-utils';
|
|
24
|
+
|
|
25
|
+
@injectable()
|
|
26
|
+
export class LocalVSIXFilePluginDeployerResolver extends LocalPluginDeployerResolver {
|
|
27
|
+
static LOCAL_FILE = 'local-file';
|
|
28
|
+
static FILE_EXTENSION = '.vsix';
|
|
29
|
+
|
|
30
|
+
@inject(PluginVSCodeEnvironment) protected readonly environment: PluginVSCodeEnvironment;
|
|
31
|
+
|
|
32
|
+
protected get supportedScheme(): string {
|
|
33
|
+
return LocalVSIXFilePluginDeployerResolver.LOCAL_FILE;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
override accept(pluginId: string): boolean {
|
|
37
|
+
return super.accept(pluginId) && isVSCodePluginFile(pluginId);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async resolveFromLocalPath(pluginResolverContext: PluginDeployerResolverContext, localPath: string): Promise<void> {
|
|
41
|
+
const extensionId = path.basename(localPath, LocalVSIXFilePluginDeployerResolver.FILE_EXTENSION);
|
|
42
|
+
|
|
43
|
+
if (await existsInDeploymentDir(this.environment, extensionId)) {
|
|
44
|
+
console.log(`[${pluginResolverContext.getOriginId()}]: Target dir already exists in plugin deployment dir`);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const extensionDeploymentDir = await unpackToDeploymentDir(this.environment, localPath, extensionId);
|
|
49
|
+
pluginResolverContext.addPlugin(extensionId, extensionDeploymentDir);
|
|
50
|
+
}
|
|
51
|
+
}
|