@theia/plugin-ext-vscode 1.34.3 → 1.34.4

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 (53) hide show
  1. package/LICENSE +641 -641
  2. package/README.md +32 -32
  3. package/lib/browser/plugin-vscode-commands-contribution.d.ts +79 -79
  4. package/lib/browser/plugin-vscode-commands-contribution.js +768 -768
  5. package/lib/browser/plugin-vscode-contribution.d.ts +5 -5
  6. package/lib/browser/plugin-vscode-contribution.js +53 -53
  7. package/lib/browser/plugin-vscode-frontend-module.d.ts +3 -3
  8. package/lib/browser/plugin-vscode-frontend-module.js +30 -30
  9. package/lib/common/plugin-vscode-environment.d.ts +7 -7
  10. package/lib/common/plugin-vscode-environment.js +47 -47
  11. package/lib/common/plugin-vscode-types.d.ts +2 -2
  12. package/lib/common/plugin-vscode-types.js +21 -21
  13. package/lib/common/plugin-vscode-uri.d.ts +16 -16
  14. package/lib/common/plugin-vscode-uri.js +51 -51
  15. package/lib/node/context/plugin-vscode-init-fe.d.ts +2 -2
  16. package/lib/node/context/plugin-vscode-init-fe.js +37 -37
  17. package/lib/node/local-vsix-file-plugin-deployer-resolver.d.ts +14 -14
  18. package/lib/node/local-vsix-file-plugin-deployer-resolver.js +77 -77
  19. package/lib/node/package.spec.js +25 -25
  20. package/lib/node/plugin-reader.d.ts +6 -6
  21. package/lib/node/plugin-reader.js +36 -36
  22. package/lib/node/plugin-vscode-backend-module.d.ts +3 -3
  23. package/lib/node/plugin-vscode-backend-module.js +43 -43
  24. package/lib/node/plugin-vscode-cli-contribution.d.ts +21 -21
  25. package/lib/node/plugin-vscode-cli-contribution.js +67 -67
  26. package/lib/node/plugin-vscode-deployer-participant.d.ts +6 -6
  27. package/lib/node/plugin-vscode-deployer-participant.js +43 -43
  28. package/lib/node/plugin-vscode-directory-handler.d.ts +21 -21
  29. package/lib/node/plugin-vscode-directory-handler.js +144 -144
  30. package/lib/node/plugin-vscode-file-handler.d.ts +11 -11
  31. package/lib/node/plugin-vscode-file-handler.js +82 -82
  32. package/lib/node/plugin-vscode-init.d.ts +2 -2
  33. package/lib/node/plugin-vscode-init.js +68 -68
  34. package/lib/node/scanner-vscode.d.ts +12 -12
  35. package/lib/node/scanner-vscode.js +111 -111
  36. package/package.json +15 -15
  37. package/src/browser/plugin-vscode-commands-contribution.ts +924 -924
  38. package/src/browser/plugin-vscode-contribution.ts +47 -47
  39. package/src/browser/plugin-vscode-frontend-module.ts +30 -30
  40. package/src/common/plugin-vscode-environment.ts +36 -36
  41. package/src/common/plugin-vscode-types.ts +20 -20
  42. package/src/common/plugin-vscode-uri.ts +47 -47
  43. package/src/node/context/plugin-vscode-init-fe.ts +43 -43
  44. package/src/node/local-vsix-file-plugin-deployer-resolver.ts +65 -65
  45. package/src/node/package.spec.ts +28 -28
  46. package/src/node/plugin-reader.ts +28 -28
  47. package/src/node/plugin-vscode-backend-module.ts +50 -50
  48. package/src/node/plugin-vscode-cli-contribution.ts +64 -64
  49. package/src/node/plugin-vscode-deployer-participant.ts +32 -32
  50. package/src/node/plugin-vscode-directory-handler.ts +141 -141
  51. package/src/node/plugin-vscode-file-handler.ts +72 -72
  52. package/src/node/plugin-vscode-init.ts +80 -80
  53. package/src/node/scanner-vscode.ts +108 -108
@@ -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 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 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 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 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,36 +1,36 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2020 TypeFox and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { 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 _extensionsDirUri: URI | undefined;
28
- async getExtensionsDirUri(): Promise<URI> {
29
- if (!this._extensionsDirUri) {
30
- const configDir = new URI(await this.environments.getConfigDirUri());
31
- this._extensionsDirUri = configDir.resolve('extensions');
32
- }
33
- return this._extensionsDirUri;
34
- }
35
-
36
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2020 TypeFox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { 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 _extensionsDirUri: URI | undefined;
28
+ async getExtensionsDirUri(): Promise<URI> {
29
+ if (!this._extensionsDirUri) {
30
+ const configDir = new URI(await this.environments.getConfigDirUri());
31
+ this._extensionsDirUri = configDir.resolve('extensions');
32
+ }
33
+ return this._extensionsDirUri;
34
+ }
35
+
36
+ }
@@ -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 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 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,47 +1,47 @@
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 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 VSCODE_PREFIX = 'vscode:extension/';
25
- /**
26
- * Should be used to prefix a plugin's ID to ensure that it is identified as a VSX Extension.
27
- * @returns `vscode:extension/${id}`
28
- */
29
- export function toVsxExtensionUriString(id: string): string {
30
- return `${VSCODE_PREFIX}${id}`;
31
- }
32
- export function toUri(name: string, namespace: string): URI;
33
- export function toUri(id: string): URI;
34
- export function toUri(idOrName: string, namespace?: string): URI {
35
- if (typeof namespace === 'string') {
36
- return new URI(toVsxExtensionUriString(`${namespace}.${idOrName}`));
37
- } else {
38
- return new URI(toVsxExtensionUriString(idOrName));
39
- }
40
- }
41
- export function toId(uri: URI): string | undefined {
42
- if (uri.scheme === 'vscode' && uri.path.dir.toString() === 'extension') {
43
- return uri.path.base;
44
- }
45
- return undefined;
46
- }
47
- }
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 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 VSCODE_PREFIX = 'vscode:extension/';
25
+ /**
26
+ * Should be used to prefix a plugin's ID to ensure that it is identified as a VSX Extension.
27
+ * @returns `vscode:extension/${id}`
28
+ */
29
+ export function toVsxExtensionUriString(id: string): string {
30
+ return `${VSCODE_PREFIX}${id}`;
31
+ }
32
+ export function toUri(name: string, namespace: string): URI;
33
+ export function toUri(id: string): URI;
34
+ export function toUri(idOrName: string, namespace?: string): URI {
35
+ if (typeof namespace === 'string') {
36
+ return new URI(toVsxExtensionUriString(`${namespace}.${idOrName}`));
37
+ } else {
38
+ return new URI(toVsxExtensionUriString(idOrName));
39
+ }
40
+ }
41
+ export function toId(uri: URI): string | undefined {
42
+ if (uri.scheme === 'vscode' && uri.path.dir.toString() === 'extension') {
43
+ return uri.path.base;
44
+ }
45
+ return undefined;
46
+ }
47
+ }
@@ -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 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 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,65 +1,65 @@
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 WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import * as fs from '@theia/core/shared/fs-extra';
18
- import * as path from 'path';
19
- import { inject, injectable } from '@theia/core/shared/inversify';
20
- import { FileUri } from '@theia/core/lib/node';
21
- import { PluginDeployerResolverContext } from '@theia/plugin-ext';
22
- import { LocalPluginDeployerResolver } from '@theia/plugin-ext/lib/main/node/resolvers/local-plugin-deployer-resolver';
23
- import { PluginVSCodeEnvironment } from '../common/plugin-vscode-environment';
24
- import { isVSCodePluginFile } from './plugin-vscode-file-handler';
25
-
26
- @injectable()
27
- export class LocalVSIXFilePluginDeployerResolver extends LocalPluginDeployerResolver {
28
- static LOCAL_FILE = 'local-file';
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 fileName = path.basename(localPath);
42
- const pathInUserExtensionsDirectory = await this.ensureDiscoverability(localPath);
43
- pluginResolverContext.addPlugin(fileName, pathInUserExtensionsDirectory);
44
- }
45
-
46
- /**
47
- * Ensures that a user-installed plugin file is transferred to the user extension folder.
48
- */
49
- protected async ensureDiscoverability(localPath: string): Promise<string> {
50
- const userExtensionsDir = await this.environment.getExtensionsDirUri();
51
- if (!userExtensionsDir.isEqualOrParent(FileUri.create(localPath))) {
52
- try {
53
- const newPath = FileUri.fsPath(userExtensionsDir.resolve(path.basename(localPath)));
54
- await fs.mkdirp(FileUri.fsPath(userExtensionsDir));
55
- await new Promise<void>((resolve, reject) => {
56
- fs.copyFile(localPath, newPath, error => error ? reject(error) : resolve());
57
- });
58
- return newPath;
59
- } catch (e) {
60
- console.warn(`Problem copying plugin at ${localPath}:`, e);
61
- }
62
- }
63
- return localPath;
64
- }
65
- }
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 WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import * as fs from '@theia/core/shared/fs-extra';
18
+ import * as path from 'path';
19
+ import { inject, injectable } from '@theia/core/shared/inversify';
20
+ import { FileUri } from '@theia/core/lib/node';
21
+ import { PluginDeployerResolverContext } from '@theia/plugin-ext';
22
+ import { LocalPluginDeployerResolver } from '@theia/plugin-ext/lib/main/node/resolvers/local-plugin-deployer-resolver';
23
+ import { PluginVSCodeEnvironment } from '../common/plugin-vscode-environment';
24
+ import { isVSCodePluginFile } from './plugin-vscode-file-handler';
25
+
26
+ @injectable()
27
+ export class LocalVSIXFilePluginDeployerResolver extends LocalPluginDeployerResolver {
28
+ static LOCAL_FILE = 'local-file';
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 fileName = path.basename(localPath);
42
+ const pathInUserExtensionsDirectory = await this.ensureDiscoverability(localPath);
43
+ pluginResolverContext.addPlugin(fileName, pathInUserExtensionsDirectory);
44
+ }
45
+
46
+ /**
47
+ * Ensures that a user-installed plugin file is transferred to the user extension folder.
48
+ */
49
+ protected async ensureDiscoverability(localPath: string): Promise<string> {
50
+ const userExtensionsDir = await this.environment.getExtensionsDirUri();
51
+ if (!userExtensionsDir.isEqualOrParent(FileUri.create(localPath))) {
52
+ try {
53
+ const newPath = FileUri.fsPath(userExtensionsDir.resolve(path.basename(localPath)));
54
+ await fs.mkdirp(FileUri.fsPath(userExtensionsDir));
55
+ await new Promise<void>((resolve, reject) => {
56
+ fs.copyFile(localPath, newPath, error => error ? reject(error) : resolve());
57
+ });
58
+ return newPath;
59
+ } catch (e) {
60
+ console.warn(`Problem copying plugin at ${localPath}:`, e);
61
+ }
62
+ }
63
+ return localPath;
64
+ }
65
+ }