@theia/terminal 1.53.0-next.5 → 1.53.0-next.55

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 (45) hide show
  1. package/README.md +30 -30
  2. package/lib/browser/terminal-link-provider.d.ts +1 -1
  3. package/lib/browser/terminal-link-provider.d.ts.map +1 -1
  4. package/lib/browser/terminal-widget-impl.js +4 -4
  5. package/package.json +10 -10
  6. package/src/browser/base/terminal-service.ts +60 -60
  7. package/src/browser/base/terminal-widget.ts +268 -268
  8. package/src/browser/index.ts +17 -17
  9. package/src/browser/search/terminal-search-container.ts +28 -28
  10. package/src/browser/search/terminal-search-widget.tsx +161 -161
  11. package/src/browser/shell-terminal-profile.ts +45 -45
  12. package/src/browser/style/terminal-search.css +99 -99
  13. package/src/browser/style/terminal.css +32 -32
  14. package/src/browser/terminal-contribution.ts +19 -19
  15. package/src/browser/terminal-copy-on-selection-handler.ts +92 -92
  16. package/src/browser/terminal-file-link-provider.ts +289 -289
  17. package/src/browser/terminal-frontend-contribution.ts +1134 -1134
  18. package/src/browser/terminal-frontend-module.ts +138 -138
  19. package/src/browser/terminal-link-helpers.ts +187 -187
  20. package/src/browser/terminal-link-provider.ts +203 -203
  21. package/src/browser/terminal-preferences.ts +428 -428
  22. package/src/browser/terminal-profile-service.ts +180 -180
  23. package/src/browser/terminal-quick-open-service.ts +132 -132
  24. package/src/browser/terminal-theme-service.ts +213 -213
  25. package/src/browser/terminal-url-link-provider.ts +66 -66
  26. package/src/browser/terminal-widget-impl.ts +996 -996
  27. package/src/common/base-terminal-protocol.ts +125 -125
  28. package/src/common/shell-terminal-protocol.ts +103 -103
  29. package/src/common/terminal-common-module.ts +30 -30
  30. package/src/common/terminal-protocol.ts +32 -32
  31. package/src/common/terminal-watcher.ts +69 -69
  32. package/src/node/base-terminal-server.ts +173 -173
  33. package/src/node/buffering-stream.spec.ts +46 -46
  34. package/src/node/buffering-stream.ts +95 -95
  35. package/src/node/index.ts +17 -17
  36. package/src/node/shell-process.ts +102 -102
  37. package/src/node/shell-terminal-server.spec.ts +40 -40
  38. package/src/node/shell-terminal-server.ts +223 -223
  39. package/src/node/terminal-backend-contribution.slow-spec.ts +63 -63
  40. package/src/node/terminal-backend-contribution.ts +60 -60
  41. package/src/node/terminal-backend-module.ts +82 -82
  42. package/src/node/terminal-server.spec.ts +47 -47
  43. package/src/node/terminal-server.ts +52 -52
  44. package/src/node/test/terminal-test-container.ts +39 -39
  45. package/src/package.spec.ts +28 -28
@@ -1,60 +1,60 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2017 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, named } from '@theia/core/shared/inversify';
18
- import { ILogger } from '@theia/core/lib/common';
19
- import { TerminalProcess, ProcessManager } from '@theia/process/lib/node';
20
- import { terminalsPath } from '../common/terminal-protocol';
21
- import { MessagingService } from '@theia/core/lib/node/messaging/messaging-service';
22
- import { StringBufferingStream } from './buffering-stream';
23
-
24
- @injectable()
25
- export class TerminalBackendContribution implements MessagingService.Contribution {
26
- protected readonly decoder = new TextDecoder('utf-8');
27
-
28
- @inject(ProcessManager)
29
- protected readonly processManager: ProcessManager;
30
-
31
- @inject(ILogger) @named('terminal')
32
- protected readonly logger: ILogger;
33
-
34
- configure(service: MessagingService): void {
35
- service.registerChannelHandler(`${terminalsPath}/:id`, (params: { id: string }, channel) => {
36
- const id = parseInt(params.id, 10);
37
- const termProcess = this.processManager.get(id);
38
- if (termProcess instanceof TerminalProcess) {
39
- const output = termProcess.createOutputStream();
40
- // Create a RPC connection to the terminal process
41
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
42
- channel.onMessage(e => {
43
- termProcess.write(e().readString());
44
- });
45
-
46
- const buffer = new StringBufferingStream();
47
- buffer.onData(chunk => {
48
- channel.getWriteBuffer().writeString(chunk).commit();
49
- });
50
- output.on('data', chunk => {
51
- buffer.push(chunk);
52
- });
53
- channel.onClose(() => {
54
- buffer.dispose();
55
- output.dispose();
56
- });
57
- }
58
- });
59
- }
60
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2017 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, named } from '@theia/core/shared/inversify';
18
+ import { ILogger } from '@theia/core/lib/common';
19
+ import { TerminalProcess, ProcessManager } from '@theia/process/lib/node';
20
+ import { terminalsPath } from '../common/terminal-protocol';
21
+ import { MessagingService } from '@theia/core/lib/node/messaging/messaging-service';
22
+ import { StringBufferingStream } from './buffering-stream';
23
+
24
+ @injectable()
25
+ export class TerminalBackendContribution implements MessagingService.Contribution {
26
+ protected readonly decoder = new TextDecoder('utf-8');
27
+
28
+ @inject(ProcessManager)
29
+ protected readonly processManager: ProcessManager;
30
+
31
+ @inject(ILogger) @named('terminal')
32
+ protected readonly logger: ILogger;
33
+
34
+ configure(service: MessagingService): void {
35
+ service.registerChannelHandler(`${terminalsPath}/:id`, (params: { id: string }, channel) => {
36
+ const id = parseInt(params.id, 10);
37
+ const termProcess = this.processManager.get(id);
38
+ if (termProcess instanceof TerminalProcess) {
39
+ const output = termProcess.createOutputStream();
40
+ // Create a RPC connection to the terminal process
41
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
42
+ channel.onMessage(e => {
43
+ termProcess.write(e().readString());
44
+ });
45
+
46
+ const buffer = new StringBufferingStream();
47
+ buffer.onData(chunk => {
48
+ channel.getWriteBuffer().writeString(chunk).commit();
49
+ });
50
+ output.on('data', chunk => {
51
+ buffer.push(chunk);
52
+ });
53
+ channel.onClose(() => {
54
+ buffer.dispose();
55
+ output.dispose();
56
+ });
57
+ }
58
+ });
59
+ }
60
+ }
@@ -1,82 +1,82 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2017 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 { ContainerModule, Container, interfaces } from '@theia/core/shared/inversify';
18
- import { TerminalBackendContribution } from './terminal-backend-contribution';
19
- import { ConnectionHandler, RpcConnectionHandler } from '@theia/core/lib/common/messaging';
20
- import { ShellProcess, ShellProcessFactory, ShellProcessOptions } from './shell-process';
21
- import { ITerminalServer, terminalPath } from '../common/terminal-protocol';
22
- import { IBaseTerminalClient, DispatchingBaseTerminalClient, IBaseTerminalServer } from '../common/base-terminal-protocol';
23
- import { TerminalServer } from './terminal-server';
24
- import { IShellTerminalServer, shellTerminalPath } from '../common/shell-terminal-protocol';
25
- import { ShellTerminalServer } from '../node/shell-terminal-server';
26
- import { TerminalWatcher } from '../common/terminal-watcher';
27
- import { createCommonBindings } from '../common/terminal-common-module';
28
- import { MessagingService } from '@theia/core/lib/node/messaging/messaging-service';
29
-
30
- export function bindTerminalServer(bind: interfaces.Bind, { path, identifier, constructor }: {
31
- path: string,
32
- identifier: interfaces.ServiceIdentifier<IBaseTerminalServer>,
33
- constructor: {
34
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
- new(...args: any[]): IBaseTerminalServer;
36
- }
37
- }): void {
38
- const dispatchingClient = new DispatchingBaseTerminalClient();
39
- bind<IBaseTerminalServer>(identifier).to(constructor).inSingletonScope().onActivation((context, terminalServer) => {
40
- terminalServer.setClient(dispatchingClient);
41
- dispatchingClient.push(context.container.get(TerminalWatcher).getTerminalClient());
42
- terminalServer.setClient = () => {
43
- throw new Error('use TerminalWatcher');
44
- };
45
- return terminalServer;
46
- });
47
- bind(ConnectionHandler).toDynamicValue(ctx =>
48
- new RpcConnectionHandler<IBaseTerminalClient>(path, client => {
49
- const disposable = dispatchingClient.push(client);
50
- client.onDidCloseConnection(() => disposable.dispose());
51
- return ctx.container.get(identifier);
52
- })
53
- ).inSingletonScope();
54
- }
55
-
56
- export default new ContainerModule(bind => {
57
- bind(MessagingService.Contribution).to(TerminalBackendContribution).inSingletonScope();
58
-
59
- bind(ShellProcess).toSelf().inTransientScope();
60
- bind(ShellProcessFactory).toFactory(ctx =>
61
- (options: ShellProcessOptions) => {
62
- const child = new Container({ defaultScope: 'Singleton' });
63
- child.parent = ctx.container;
64
- child.bind(ShellProcessOptions).toConstantValue(options);
65
- return child.get(ShellProcess);
66
- }
67
- );
68
-
69
- bind(TerminalWatcher).toSelf().inSingletonScope();
70
- bindTerminalServer(bind, {
71
- path: terminalPath,
72
- identifier: ITerminalServer,
73
- constructor: TerminalServer
74
- });
75
- bindTerminalServer(bind, {
76
- path: shellTerminalPath,
77
- identifier: IShellTerminalServer,
78
- constructor: ShellTerminalServer
79
- });
80
-
81
- createCommonBindings(bind);
82
- });
1
+ // *****************************************************************************
2
+ // Copyright (C) 2017 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 { ContainerModule, Container, interfaces } from '@theia/core/shared/inversify';
18
+ import { TerminalBackendContribution } from './terminal-backend-contribution';
19
+ import { ConnectionHandler, RpcConnectionHandler } from '@theia/core/lib/common/messaging';
20
+ import { ShellProcess, ShellProcessFactory, ShellProcessOptions } from './shell-process';
21
+ import { ITerminalServer, terminalPath } from '../common/terminal-protocol';
22
+ import { IBaseTerminalClient, DispatchingBaseTerminalClient, IBaseTerminalServer } from '../common/base-terminal-protocol';
23
+ import { TerminalServer } from './terminal-server';
24
+ import { IShellTerminalServer, shellTerminalPath } from '../common/shell-terminal-protocol';
25
+ import { ShellTerminalServer } from '../node/shell-terminal-server';
26
+ import { TerminalWatcher } from '../common/terminal-watcher';
27
+ import { createCommonBindings } from '../common/terminal-common-module';
28
+ import { MessagingService } from '@theia/core/lib/node/messaging/messaging-service';
29
+
30
+ export function bindTerminalServer(bind: interfaces.Bind, { path, identifier, constructor }: {
31
+ path: string,
32
+ identifier: interfaces.ServiceIdentifier<IBaseTerminalServer>,
33
+ constructor: {
34
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
+ new(...args: any[]): IBaseTerminalServer;
36
+ }
37
+ }): void {
38
+ const dispatchingClient = new DispatchingBaseTerminalClient();
39
+ bind<IBaseTerminalServer>(identifier).to(constructor).inSingletonScope().onActivation((context, terminalServer) => {
40
+ terminalServer.setClient(dispatchingClient);
41
+ dispatchingClient.push(context.container.get(TerminalWatcher).getTerminalClient());
42
+ terminalServer.setClient = () => {
43
+ throw new Error('use TerminalWatcher');
44
+ };
45
+ return terminalServer;
46
+ });
47
+ bind(ConnectionHandler).toDynamicValue(ctx =>
48
+ new RpcConnectionHandler<IBaseTerminalClient>(path, client => {
49
+ const disposable = dispatchingClient.push(client);
50
+ client.onDidCloseConnection(() => disposable.dispose());
51
+ return ctx.container.get(identifier);
52
+ })
53
+ ).inSingletonScope();
54
+ }
55
+
56
+ export default new ContainerModule(bind => {
57
+ bind(MessagingService.Contribution).to(TerminalBackendContribution).inSingletonScope();
58
+
59
+ bind(ShellProcess).toSelf().inTransientScope();
60
+ bind(ShellProcessFactory).toFactory(ctx =>
61
+ (options: ShellProcessOptions) => {
62
+ const child = new Container({ defaultScope: 'Singleton' });
63
+ child.parent = ctx.container;
64
+ child.bind(ShellProcessOptions).toConstantValue(options);
65
+ return child.get(ShellProcess);
66
+ }
67
+ );
68
+
69
+ bind(TerminalWatcher).toSelf().inSingletonScope();
70
+ bindTerminalServer(bind, {
71
+ path: terminalPath,
72
+ identifier: ITerminalServer,
73
+ constructor: TerminalServer
74
+ });
75
+ bindTerminalServer(bind, {
76
+ path: shellTerminalPath,
77
+ identifier: IShellTerminalServer,
78
+ constructor: ShellTerminalServer
79
+ });
80
+
81
+ createCommonBindings(bind);
82
+ });
@@ -1,47 +1,47 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2017 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 * as chai from 'chai';
18
- import { createTerminalTestContainer } from './test/terminal-test-container';
19
- import { ITerminalServer } from '../common/terminal-protocol';
20
-
21
- /**
22
- * Globals
23
- */
24
-
25
- const expect = chai.expect;
26
-
27
- describe('TerminalServer', function (): void {
28
-
29
- this.timeout(5000);
30
- let terminalServer: ITerminalServer;
31
-
32
- beforeEach(() => {
33
- const container = createTerminalTestContainer();
34
- terminalServer = container.get(ITerminalServer);
35
- });
36
-
37
- it('test terminal create', async function (): Promise<void> {
38
- const args = ['--version'];
39
- const createResult = await terminalServer.create({ command: process.execPath, 'args': args });
40
- expect(createResult).to.be.greaterThan(-1);
41
- });
42
-
43
- it('test terminal create from non-existent path', async function (): Promise<void> {
44
- const createError = await terminalServer.create({ command: '/non-existent' });
45
- expect(createError).eq(-1);
46
- });
47
- });
1
+ // *****************************************************************************
2
+ // Copyright (C) 2017 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 * as chai from 'chai';
18
+ import { createTerminalTestContainer } from './test/terminal-test-container';
19
+ import { ITerminalServer } from '../common/terminal-protocol';
20
+
21
+ /**
22
+ * Globals
23
+ */
24
+
25
+ const expect = chai.expect;
26
+
27
+ describe('TerminalServer', function (): void {
28
+
29
+ this.timeout(5000);
30
+ let terminalServer: ITerminalServer;
31
+
32
+ beforeEach(() => {
33
+ const container = createTerminalTestContainer();
34
+ terminalServer = container.get(ITerminalServer);
35
+ });
36
+
37
+ it('test terminal create', async function (): Promise<void> {
38
+ const args = ['--version'];
39
+ const createResult = await terminalServer.create({ command: process.execPath, 'args': args });
40
+ expect(createResult).to.be.greaterThan(-1);
41
+ });
42
+
43
+ it('test terminal create from non-existent path', async function (): Promise<void> {
44
+ const createError = await terminalServer.create({ command: '/non-existent' });
45
+ expect(createError).eq(-1);
46
+ });
47
+ });
@@ -1,52 +1,52 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2017 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, named } from '@theia/core/shared/inversify';
18
- import { ILogger } from '@theia/core/lib/common/logger';
19
- import {
20
- ITerminalServer,
21
- ITerminalServerOptions
22
- } from '../common/terminal-protocol';
23
- import { BaseTerminalServer } from './base-terminal-server';
24
- import { TerminalProcessFactory, ProcessManager } from '@theia/process/lib/node';
25
-
26
- @injectable()
27
- export class TerminalServer extends BaseTerminalServer implements ITerminalServer {
28
-
29
- @inject(TerminalProcessFactory) protected readonly terminalFactory: TerminalProcessFactory;
30
-
31
- constructor(
32
- @inject(ProcessManager) processManager: ProcessManager,
33
- @inject(ILogger) @named('terminal') logger: ILogger,
34
- ) {
35
- super(processManager, logger);
36
- }
37
-
38
- create(options: ITerminalServerOptions): Promise<number> {
39
- return new Promise<number>((resolve, reject) => {
40
- const term = this.terminalFactory(options);
41
- term.onStart(_ => {
42
- this.postCreate(term);
43
- resolve(term.id);
44
- });
45
- term.onError(error => {
46
- this.logger.error('Error while creating terminal', error);
47
- resolve(-1);
48
- });
49
- });
50
-
51
- }
52
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2017 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, named } from '@theia/core/shared/inversify';
18
+ import { ILogger } from '@theia/core/lib/common/logger';
19
+ import {
20
+ ITerminalServer,
21
+ ITerminalServerOptions
22
+ } from '../common/terminal-protocol';
23
+ import { BaseTerminalServer } from './base-terminal-server';
24
+ import { TerminalProcessFactory, ProcessManager } from '@theia/process/lib/node';
25
+
26
+ @injectable()
27
+ export class TerminalServer extends BaseTerminalServer implements ITerminalServer {
28
+
29
+ @inject(TerminalProcessFactory) protected readonly terminalFactory: TerminalProcessFactory;
30
+
31
+ constructor(
32
+ @inject(ProcessManager) processManager: ProcessManager,
33
+ @inject(ILogger) @named('terminal') logger: ILogger,
34
+ ) {
35
+ super(processManager, logger);
36
+ }
37
+
38
+ create(options: ITerminalServerOptions): Promise<number> {
39
+ return new Promise<number>((resolve, reject) => {
40
+ const term = this.terminalFactory(options);
41
+ term.onStart(_ => {
42
+ this.postCreate(term);
43
+ resolve(term.id);
44
+ });
45
+ term.onError(error => {
46
+ this.logger.error('Error while creating terminal', error);
47
+ resolve(-1);
48
+ });
49
+ });
50
+
51
+ }
52
+ }
@@ -1,39 +1,39 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2017 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
- import { Container } from '@theia/core/shared/inversify';
17
- import { bindLogger } from '@theia/core/lib/node/logger-backend-module';
18
- import { backendApplicationModule } from '@theia/core/lib/node/backend-application-module';
19
- import processBackendModule from '@theia/process/lib/node/process-backend-module';
20
- import { messagingBackendModule } from '@theia/core/lib/node/messaging/messaging-backend-module';
21
- import terminalBackendModule from '../terminal-backend-module';
22
- import { ApplicationPackage } from '@theia/core/shared/@theia/application-package';
23
- import { ProcessUtils } from '@theia/core/lib/node/process-utils';
24
-
25
- export function createTerminalTestContainer(): Container {
26
- const container = new Container();
27
-
28
- container.load(backendApplicationModule);
29
- container.rebind(ApplicationPackage).toConstantValue({} as ApplicationPackage);
30
- container.rebind(ProcessUtils).toConstantValue(new class extends ProcessUtils {
31
- override terminateProcessTree(): void { }
32
- });
33
-
34
- bindLogger(container.bind.bind(container));
35
- container.load(messagingBackendModule);
36
- container.load(processBackendModule);
37
- container.load(terminalBackendModule);
38
- return container;
39
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2017 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
+ import { Container } from '@theia/core/shared/inversify';
17
+ import { bindLogger } from '@theia/core/lib/node/logger-backend-module';
18
+ import { backendApplicationModule } from '@theia/core/lib/node/backend-application-module';
19
+ import processBackendModule from '@theia/process/lib/node/process-backend-module';
20
+ import { messagingBackendModule } from '@theia/core/lib/node/messaging/messaging-backend-module';
21
+ import terminalBackendModule from '../terminal-backend-module';
22
+ import { ApplicationPackage } from '@theia/core/shared/@theia/application-package';
23
+ import { ProcessUtils } from '@theia/core/lib/node/process-utils';
24
+
25
+ export function createTerminalTestContainer(): Container {
26
+ const container = new Container();
27
+
28
+ container.load(backendApplicationModule);
29
+ container.rebind(ApplicationPackage).toConstantValue({} as ApplicationPackage);
30
+ container.rebind(ProcessUtils).toConstantValue(new class extends ProcessUtils {
31
+ override terminateProcessTree(): void { }
32
+ });
33
+
34
+ bindLogger(container.bind.bind(container));
35
+ container.load(messagingBackendModule);
36
+ container.load(processBackendModule);
37
+ container.load(terminalBackendModule);
38
+ return container;
39
+ }
@@ -1,28 +1,28 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2017 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
- /* 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('terminal package', () => {
26
-
27
- it('support code coverage statistics', () => true);
28
- });
1
+ // *****************************************************************************
2
+ // Copyright (C) 2017 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
+ /* 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('terminal package', () => {
26
+
27
+ it('support code coverage statistics', () => true);
28
+ });