@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.
- package/LICENSE +641 -641
- package/README.md +32 -32
- package/lib/browser/plugin-vscode-commands-contribution.d.ts +79 -79
- package/lib/browser/plugin-vscode-commands-contribution.js +768 -768
- package/lib/browser/plugin-vscode-contribution.d.ts +5 -5
- package/lib/browser/plugin-vscode-contribution.js +53 -53
- package/lib/browser/plugin-vscode-frontend-module.d.ts +3 -3
- package/lib/browser/plugin-vscode-frontend-module.js +30 -30
- package/lib/common/plugin-vscode-environment.d.ts +7 -7
- package/lib/common/plugin-vscode-environment.js +47 -47
- package/lib/common/plugin-vscode-types.d.ts +2 -2
- package/lib/common/plugin-vscode-types.js +21 -21
- package/lib/common/plugin-vscode-uri.d.ts +16 -16
- package/lib/common/plugin-vscode-uri.js +51 -51
- package/lib/node/context/plugin-vscode-init-fe.d.ts +2 -2
- package/lib/node/context/plugin-vscode-init-fe.js +37 -37
- package/lib/node/local-vsix-file-plugin-deployer-resolver.d.ts +14 -14
- package/lib/node/local-vsix-file-plugin-deployer-resolver.js +77 -77
- package/lib/node/package.spec.js +25 -25
- package/lib/node/plugin-reader.d.ts +6 -6
- package/lib/node/plugin-reader.js +36 -36
- package/lib/node/plugin-vscode-backend-module.d.ts +3 -3
- package/lib/node/plugin-vscode-backend-module.js +43 -43
- package/lib/node/plugin-vscode-cli-contribution.d.ts +21 -21
- package/lib/node/plugin-vscode-cli-contribution.js +67 -67
- package/lib/node/plugin-vscode-deployer-participant.d.ts +6 -6
- package/lib/node/plugin-vscode-deployer-participant.js +43 -43
- package/lib/node/plugin-vscode-directory-handler.d.ts +21 -21
- package/lib/node/plugin-vscode-directory-handler.js +144 -144
- package/lib/node/plugin-vscode-file-handler.d.ts +11 -11
- package/lib/node/plugin-vscode-file-handler.js +82 -82
- package/lib/node/plugin-vscode-init.d.ts +2 -2
- package/lib/node/plugin-vscode-init.js +68 -68
- package/lib/node/scanner-vscode.d.ts +12 -12
- package/lib/node/scanner-vscode.js +111 -111
- package/package.json +15 -15
- package/src/browser/plugin-vscode-commands-contribution.ts +924 -924
- 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 +36 -36
- package/src/common/plugin-vscode-types.ts +20 -20
- package/src/common/plugin-vscode-uri.ts +47 -47
- package/src/node/context/plugin-vscode-init-fe.ts +43 -43
- package/src/node/local-vsix-file-plugin-deployer-resolver.ts +65 -65
- package/src/node/package.spec.ts +28 -28
- package/src/node/plugin-reader.ts +28 -28
- package/src/node/plugin-vscode-backend-module.ts +50 -50
- package/src/node/plugin-vscode-cli-contribution.ts +64 -64
- package/src/node/plugin-vscode-deployer-participant.ts +32 -32
- package/src/node/plugin-vscode-directory-handler.ts +141 -141
- package/src/node/plugin-vscode-file-handler.ts +72 -72
- package/src/node/plugin-vscode-init.ts +80 -80
- package/src/node/scanner-vscode.ts +108 -108
package/src/node/package.spec.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
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
|
-
/* note: this bogus test file is required so that
|
|
18
|
-
we are able to run mocha unit tests on this
|
|
19
|
-
package, without having any actual unit tests in it.
|
|
20
|
-
This way a coverage report will be generated,
|
|
21
|
-
showing 0% coverage, instead of no report.
|
|
22
|
-
This file can be removed once we have real unit
|
|
23
|
-
tests in place. */
|
|
24
|
-
|
|
25
|
-
describe('plugin-ext-vscode package', () => {
|
|
26
|
-
|
|
27
|
-
it('support code coverage statistics', () => true);
|
|
28
|
-
});
|
|
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
|
+
/* note: this bogus test file is required so that
|
|
18
|
+
we are able to run mocha unit tests on this
|
|
19
|
+
package, without having any actual unit tests in it.
|
|
20
|
+
This way a coverage report will be generated,
|
|
21
|
+
showing 0% coverage, instead of no report.
|
|
22
|
+
This file can be removed once we have real unit
|
|
23
|
+
tests in place. */
|
|
24
|
+
|
|
25
|
+
describe('plugin-ext-vscode package', () => {
|
|
26
|
+
|
|
27
|
+
it('support code coverage statistics', () => true);
|
|
28
|
+
});
|
|
@@ -1,28 +1,28 @@
|
|
|
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
|
-
import * as path from 'path';
|
|
18
|
-
import { injectable } from '@theia/core/shared/inversify';
|
|
19
|
-
import { Application, static as ExpressStatic } from '@theia/core/shared/express';
|
|
20
|
-
import { BackendApplicationContribution } from '@theia/core/lib/node/backend-application';
|
|
21
|
-
|
|
22
|
-
@injectable()
|
|
23
|
-
export class HostedPluginReader implements BackendApplicationContribution {
|
|
24
|
-
|
|
25
|
-
configure(app: Application): void {
|
|
26
|
-
app.use('/context', ExpressStatic(path.join(__dirname, 'context')));
|
|
27
|
-
}
|
|
28
|
-
}
|
|
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
|
+
import * as path from 'path';
|
|
18
|
+
import { injectable } from '@theia/core/shared/inversify';
|
|
19
|
+
import { Application, static as ExpressStatic } from '@theia/core/shared/express';
|
|
20
|
+
import { BackendApplicationContribution } from '@theia/core/lib/node/backend-application';
|
|
21
|
+
|
|
22
|
+
@injectable()
|
|
23
|
+
export class HostedPluginReader implements BackendApplicationContribution {
|
|
24
|
+
|
|
25
|
+
configure(app: Application): void {
|
|
26
|
+
app.use('/context', ExpressStatic(path.join(__dirname, 'context')));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,50 +1,50 @@
|
|
|
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 {
|
|
19
|
-
PluginDeployerFileHandler, PluginDeployerDirectoryHandler, PluginScanner, PluginDeployerParticipant, PluginDeployerResolver
|
|
20
|
-
} from '@theia/plugin-ext';
|
|
21
|
-
import { PluginVsCodeFileHandler } from './plugin-vscode-file-handler';
|
|
22
|
-
import { PluginVsCodeDirectoryHandler } from './plugin-vscode-directory-handler';
|
|
23
|
-
import { VsCodePluginScanner } from './scanner-vscode';
|
|
24
|
-
import { PluginVsCodeCliContribution } from './plugin-vscode-cli-contribution';
|
|
25
|
-
import { BackendApplicationContribution, CliContribution } from '@theia/core/lib/node';
|
|
26
|
-
import { PluginHostEnvironmentVariable } from '@theia/plugin-ext/lib/common';
|
|
27
|
-
import { PluginVSCodeEnvironment } from '../common/plugin-vscode-environment';
|
|
28
|
-
import { PluginVSCodeDeployerParticipant } from './plugin-vscode-deployer-participant';
|
|
29
|
-
import { HostedPluginReader } from './plugin-reader';
|
|
30
|
-
import { LocalVSIXFilePluginDeployerResolver } from './local-vsix-file-plugin-deployer-resolver';
|
|
31
|
-
|
|
32
|
-
export default new ContainerModule(bind => {
|
|
33
|
-
bind(PluginVSCodeEnvironment).toSelf().inSingletonScope();
|
|
34
|
-
|
|
35
|
-
bind(PluginVSCodeDeployerParticipant).toSelf().inSingletonScope();
|
|
36
|
-
bind(PluginDeployerParticipant).toService(PluginVSCodeDeployerParticipant);
|
|
37
|
-
|
|
38
|
-
bind(PluginDeployerFileHandler).to(PluginVsCodeFileHandler).inSingletonScope();
|
|
39
|
-
bind(PluginDeployerDirectoryHandler).to(PluginVsCodeDirectoryHandler).inSingletonScope();
|
|
40
|
-
bind(PluginScanner).to(VsCodePluginScanner).inSingletonScope();
|
|
41
|
-
|
|
42
|
-
bind(PluginVsCodeCliContribution).toSelf().inSingletonScope();
|
|
43
|
-
bind(CliContribution).toService(PluginVsCodeCliContribution);
|
|
44
|
-
bind(PluginHostEnvironmentVariable).toService(PluginVsCodeCliContribution);
|
|
45
|
-
|
|
46
|
-
bind(HostedPluginReader).toSelf().inSingletonScope();
|
|
47
|
-
bind(BackendApplicationContribution).toService(HostedPluginReader);
|
|
48
|
-
|
|
49
|
-
bind(PluginDeployerResolver).to(LocalVSIXFilePluginDeployerResolver).inSingletonScope();
|
|
50
|
-
});
|
|
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 {
|
|
19
|
+
PluginDeployerFileHandler, PluginDeployerDirectoryHandler, PluginScanner, PluginDeployerParticipant, PluginDeployerResolver
|
|
20
|
+
} from '@theia/plugin-ext';
|
|
21
|
+
import { PluginVsCodeFileHandler } from './plugin-vscode-file-handler';
|
|
22
|
+
import { PluginVsCodeDirectoryHandler } from './plugin-vscode-directory-handler';
|
|
23
|
+
import { VsCodePluginScanner } from './scanner-vscode';
|
|
24
|
+
import { PluginVsCodeCliContribution } from './plugin-vscode-cli-contribution';
|
|
25
|
+
import { BackendApplicationContribution, CliContribution } from '@theia/core/lib/node';
|
|
26
|
+
import { PluginHostEnvironmentVariable } from '@theia/plugin-ext/lib/common';
|
|
27
|
+
import { PluginVSCodeEnvironment } from '../common/plugin-vscode-environment';
|
|
28
|
+
import { PluginVSCodeDeployerParticipant } from './plugin-vscode-deployer-participant';
|
|
29
|
+
import { HostedPluginReader } from './plugin-reader';
|
|
30
|
+
import { LocalVSIXFilePluginDeployerResolver } from './local-vsix-file-plugin-deployer-resolver';
|
|
31
|
+
|
|
32
|
+
export default new ContainerModule(bind => {
|
|
33
|
+
bind(PluginVSCodeEnvironment).toSelf().inSingletonScope();
|
|
34
|
+
|
|
35
|
+
bind(PluginVSCodeDeployerParticipant).toSelf().inSingletonScope();
|
|
36
|
+
bind(PluginDeployerParticipant).toService(PluginVSCodeDeployerParticipant);
|
|
37
|
+
|
|
38
|
+
bind(PluginDeployerFileHandler).to(PluginVsCodeFileHandler).inSingletonScope();
|
|
39
|
+
bind(PluginDeployerDirectoryHandler).to(PluginVsCodeDirectoryHandler).inSingletonScope();
|
|
40
|
+
bind(PluginScanner).to(VsCodePluginScanner).inSingletonScope();
|
|
41
|
+
|
|
42
|
+
bind(PluginVsCodeCliContribution).toSelf().inSingletonScope();
|
|
43
|
+
bind(CliContribution).toService(PluginVsCodeCliContribution);
|
|
44
|
+
bind(PluginHostEnvironmentVariable).toService(PluginVsCodeCliContribution);
|
|
45
|
+
|
|
46
|
+
bind(HostedPluginReader).toSelf().inSingletonScope();
|
|
47
|
+
bind(BackendApplicationContribution).toService(HostedPluginReader);
|
|
48
|
+
|
|
49
|
+
bind(PluginDeployerResolver).to(LocalVSIXFilePluginDeployerResolver).inSingletonScope();
|
|
50
|
+
});
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2019 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 { injectable } from '@theia/core/shared/inversify';
|
|
18
|
-
import { Argv, Arguments } from '@theia/core/shared/yargs';
|
|
19
|
-
import { CliContribution } from '@theia/core/lib/node/cli';
|
|
20
|
-
import { PluginHostEnvironmentVariable } from '@theia/plugin-ext/lib/common';
|
|
21
|
-
import { VSCODE_DEFAULT_API_VERSION } from '../common/plugin-vscode-types';
|
|
22
|
-
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* CLI Contribution allowing to override the VS Code API version which is returned by `vscode.version` API call.
|
|
26
|
-
*/
|
|
27
|
-
@injectable()
|
|
28
|
-
export class PluginVsCodeCliContribution implements CliContribution, PluginHostEnvironmentVariable {
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* CLI argument name to define the supported VS Code API version.
|
|
32
|
-
*/
|
|
33
|
-
static VSCODE_API_VERSION = 'vscode-api-version';
|
|
34
|
-
|
|
35
|
-
protected vsCodeApiVersion?: string;
|
|
36
|
-
protected vsCodeApiVersionDeferred = new Deferred<string>();
|
|
37
|
-
|
|
38
|
-
get vsCodeApiVersionPromise(): Promise<string> {
|
|
39
|
-
return this.vsCodeApiVersionDeferred.promise;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
configure(conf: Argv): void {
|
|
43
|
-
conf.option(PluginVsCodeCliContribution.VSCODE_API_VERSION, {
|
|
44
|
-
// eslint-disable-next-line max-len
|
|
45
|
-
description: `Overrides the version returned by VSCode API 'vscode.version'. Example: --${PluginVsCodeCliContribution.VSCODE_API_VERSION}=<Wanted Version>. Default [${VSCODE_DEFAULT_API_VERSION}]`,
|
|
46
|
-
type: 'string',
|
|
47
|
-
nargs: 1
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
setArguments(args: Arguments): void {
|
|
52
|
-
const arg = args[PluginVsCodeCliContribution.VSCODE_API_VERSION] as string | undefined;
|
|
53
|
-
this.vsCodeApiVersion = arg?.trim() || process.env['VSCODE_API_VERSION']?.trim() || VSCODE_DEFAULT_API_VERSION;
|
|
54
|
-
process.env['VSCODE_API_VERSION'] = this.vsCodeApiVersion;
|
|
55
|
-
this.vsCodeApiVersionDeferred.resolve(this.vsCodeApiVersion);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
process(env: NodeJS.ProcessEnv): void {
|
|
59
|
-
if (this.vsCodeApiVersion) {
|
|
60
|
-
env['VSCODE_API_VERSION'] = this.vsCodeApiVersion;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2019 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 { injectable } from '@theia/core/shared/inversify';
|
|
18
|
+
import { Argv, Arguments } from '@theia/core/shared/yargs';
|
|
19
|
+
import { CliContribution } from '@theia/core/lib/node/cli';
|
|
20
|
+
import { PluginHostEnvironmentVariable } from '@theia/plugin-ext/lib/common';
|
|
21
|
+
import { VSCODE_DEFAULT_API_VERSION } from '../common/plugin-vscode-types';
|
|
22
|
+
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* CLI Contribution allowing to override the VS Code API version which is returned by `vscode.version` API call.
|
|
26
|
+
*/
|
|
27
|
+
@injectable()
|
|
28
|
+
export class PluginVsCodeCliContribution implements CliContribution, PluginHostEnvironmentVariable {
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* CLI argument name to define the supported VS Code API version.
|
|
32
|
+
*/
|
|
33
|
+
static VSCODE_API_VERSION = 'vscode-api-version';
|
|
34
|
+
|
|
35
|
+
protected vsCodeApiVersion?: string;
|
|
36
|
+
protected vsCodeApiVersionDeferred = new Deferred<string>();
|
|
37
|
+
|
|
38
|
+
get vsCodeApiVersionPromise(): Promise<string> {
|
|
39
|
+
return this.vsCodeApiVersionDeferred.promise;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
configure(conf: Argv): void {
|
|
43
|
+
conf.option(PluginVsCodeCliContribution.VSCODE_API_VERSION, {
|
|
44
|
+
// eslint-disable-next-line max-len
|
|
45
|
+
description: `Overrides the version returned by VSCode API 'vscode.version'. Example: --${PluginVsCodeCliContribution.VSCODE_API_VERSION}=<Wanted Version>. Default [${VSCODE_DEFAULT_API_VERSION}]`,
|
|
46
|
+
type: 'string',
|
|
47
|
+
nargs: 1
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
setArguments(args: Arguments): void {
|
|
52
|
+
const arg = args[PluginVsCodeCliContribution.VSCODE_API_VERSION] as string | undefined;
|
|
53
|
+
this.vsCodeApiVersion = arg?.trim() || process.env['VSCODE_API_VERSION']?.trim() || VSCODE_DEFAULT_API_VERSION;
|
|
54
|
+
process.env['VSCODE_API_VERSION'] = this.vsCodeApiVersion;
|
|
55
|
+
this.vsCodeApiVersionDeferred.resolve(this.vsCodeApiVersion);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
process(env: NodeJS.ProcessEnv): void {
|
|
59
|
+
if (this.vsCodeApiVersion) {
|
|
60
|
+
env['VSCODE_API_VERSION'] = this.vsCodeApiVersion;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
}
|
|
@@ -1,32 +1,32 @@
|
|
|
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 { PluginVSCodeEnvironment } from '../common/plugin-vscode-environment';
|
|
19
|
-
import { PluginDeployerParticipant, PluginDeployerStartContext } from '@theia/plugin-ext/lib/common/plugin-protocol';
|
|
20
|
-
|
|
21
|
-
@injectable()
|
|
22
|
-
export class PluginVSCodeDeployerParticipant implements PluginDeployerParticipant {
|
|
23
|
-
|
|
24
|
-
@inject(PluginVSCodeEnvironment)
|
|
25
|
-
protected readonly environments: PluginVSCodeEnvironment;
|
|
26
|
-
|
|
27
|
-
async onWillStart(context: PluginDeployerStartContext): Promise<void> {
|
|
28
|
-
const extensionsDirUri = await this.environments.getExtensionsDirUri();
|
|
29
|
-
context.userEntries.push(extensionsDirUri.withScheme('local-dir').toString());
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
}
|
|
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 { PluginVSCodeEnvironment } from '../common/plugin-vscode-environment';
|
|
19
|
+
import { PluginDeployerParticipant, PluginDeployerStartContext } from '@theia/plugin-ext/lib/common/plugin-protocol';
|
|
20
|
+
|
|
21
|
+
@injectable()
|
|
22
|
+
export class PluginVSCodeDeployerParticipant implements PluginDeployerParticipant {
|
|
23
|
+
|
|
24
|
+
@inject(PluginVSCodeEnvironment)
|
|
25
|
+
protected readonly environments: PluginVSCodeEnvironment;
|
|
26
|
+
|
|
27
|
+
async onWillStart(context: PluginDeployerStartContext): Promise<void> {
|
|
28
|
+
const extensionsDirUri = await this.environments.getExtensionsDirUri();
|
|
29
|
+
context.userEntries.push(extensionsDirUri.withScheme('local-dir').toString());
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|