Skip to content

Commit 8f16a02

Browse files
authored
Move remote agent environment out of node (microsoft#70568)
1 parent 31c1339 commit 8f16a02

91 files changed

Lines changed: 233 additions & 169 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/tsconfig.strictNullChecks.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,10 @@
365365
"./vs/workbench/services/progress/browser/progressService.ts",
366366
"./vs/workbench/services/progress/browser/progressService2.ts",
367367
"./vs/workbench/services/progress/test/progressService.test.ts",
368+
"./vs/workbench/services/remote/common/remoteAgentService.ts",
369+
"./vs/workbench/services/remote/common/remoteEnvironmentService.ts",
368370
"./vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl.ts",
369371
"./vs/workbench/services/remote/node/remoteAgentEnvironmentChannel.ts",
370-
"./vs/workbench/services/remote/node/remoteAgentService.ts",
371372
"./vs/workbench/services/search/common/replace.ts",
372373
"./vs/workbench/services/search/common/search.ts",
373374
"./vs/workbench/services/search/common/searchHelpers.ts",
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import { CancellationToken } from 'vs/base/common/cancellation';
7+
import { Event } from 'vs/base/common/event';
8+
9+
/**
10+
* An `IChannel` is an abstraction over a collection of commands.
11+
* You can `call` several commands on a channel, each taking at
12+
* most one single argument. A `call` always returns a promise
13+
* with at most one single return value.
14+
*/
15+
export interface IChannel {
16+
call<T>(command: string, arg?: any, cancellationToken?: CancellationToken): Promise<T>;
17+
listen<T>(event: string, arg?: any): Event<T>;
18+
}
19+
20+
/**
21+
* An `IServerChannel` is the couter part to `IChannel`,
22+
* on the server-side. You should implement this interface
23+
* if you'd like to handle remote promises or events.
24+
*/
25+
export interface IServerChannel<TContext = string> {
26+
call<T>(ctx: TContext, command: string, arg?: any, cancellationToken?: CancellationToken): Promise<T>;
27+
listen<T>(ctx: TContext, event: string, arg?: any): Event<T>;
28+
}

src/vs/base/parts/ipc/node/ipc.cp.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ import { Delayer, createCancelablePromise } from 'vs/base/common/async';
99
import { deepClone, assign } from 'vs/base/common/objects';
1010
import { Emitter, Event } from 'vs/base/common/event';
1111
import { createQueuedSender } from 'vs/base/node/processes';
12-
import { ChannelServer as IPCServer, ChannelClient as IPCClient, IChannelClient, IChannel } from 'vs/base/parts/ipc/node/ipc';
12+
import { ChannelServer as IPCServer, ChannelClient as IPCClient, IChannelClient } from 'vs/base/parts/ipc/node/ipc';
1313
import { isRemoteConsoleLog, log } from 'vs/base/node/console';
1414
import { CancellationToken } from 'vs/base/common/cancellation';
1515
import * as errors from 'vs/base/common/errors';
16+
import { IChannel } from 'vs/base/parts/ipc/common/ipc';
1617

1718
/**
1819
* This implementation doesn't perform well since it uses base64 encoding for buffers.

src/vs/base/parts/ipc/node/ipc.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Event, Emitter, Relay } from 'vs/base/common/event';
88
import { CancelablePromise, createCancelablePromise, timeout } from 'vs/base/common/async';
99
import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';
1010
import * as errors from 'vs/base/common/errors';
11+
import { IServerChannel, IChannel } from 'vs/base/parts/ipc/common/ipc';
1112

1213
export const enum RequestType {
1314
Promise = 100,
@@ -51,27 +52,6 @@ enum State {
5152
Idle
5253
}
5354

54-
/**
55-
* An `IChannel` is an abstraction over a collection of commands.
56-
* You can `call` several commands on a channel, each taking at
57-
* most one single argument. A `call` always returns a promise
58-
* with at most one single return value.
59-
*/
60-
export interface IChannel {
61-
call<T>(command: string, arg?: any, cancellationToken?: CancellationToken): Promise<T>;
62-
listen<T>(event: string, arg?: any): Event<T>;
63-
}
64-
65-
/**
66-
* An `IServerChannel` is the couter part to `IChannel`,
67-
* on the server-side. You should implement this interface
68-
* if you'd like to handle remote promises or events.
69-
*/
70-
export interface IServerChannel<TContext = string> {
71-
call<T>(ctx: TContext, command: string, arg?: any, cancellationToken?: CancellationToken): Promise<T>;
72-
listen<T>(ctx: TContext, event: string, arg?: any): Event<T>;
73-
}
74-
7555
/**
7656
* An `IChannelServer` hosts a collection of channels. You are
7757
* able to register channels onto it, provided a channel name.

src/vs/base/parts/ipc/test/node/ipc.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import * as assert from 'assert';
7-
import { IMessagePassingProtocol, IPCServer, ClientConnectionEvent, IPCClient, IChannel, IServerChannel } from 'vs/base/parts/ipc/node/ipc';
7+
import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc';
8+
import { IMessagePassingProtocol, IPCServer, ClientConnectionEvent, IPCClient } from 'vs/base/parts/ipc/node/ipc';
89
import { Emitter, Event } from 'vs/base/common/event';
910
import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';
1011
import { canceled } from 'vs/base/common/errors';

src/vs/base/parts/ipc/test/node/testService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { IChannel, IServerChannel } from 'vs/base/parts/ipc/node/ipc';
6+
import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc';
77
import { Event, Emitter } from 'vs/base/common/event';
88
import { timeout } from 'vs/base/common/async';
99

src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
4141
import { IDisposable, dispose, combinedDisposable, toDisposable } from 'vs/base/common/lifecycle';
4242
import { DownloadService } from 'vs/platform/download/node/downloadService';
4343
import { IDownloadService } from 'vs/platform/download/common/download';
44-
import { StaticRouter, IServerChannel, IChannel } from 'vs/base/parts/ipc/node/ipc';
44+
import { StaticRouter } from 'vs/base/parts/ipc/node/ipc';
4545
import { NodeCachedDataCleaner } from 'vs/code/electron-browser/sharedProcess/contrib/nodeCachedDataCleaner';
4646
import { LanguagePackCachedDataCleaner } from 'vs/code/electron-browser/sharedProcess/contrib/languagePackCachedDataCleaner';
4747
import { StorageDataCleaner } from 'vs/code/electron-browser/sharedProcess/contrib/storageDataCleaner';
4848
import { LogsDataCleaner } from 'vs/code/electron-browser/sharedProcess/contrib/logsDataCleaner';
4949
import { IMainProcessService } from 'vs/platform/ipc/electron-browser/mainProcessService';
5050
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
51+
import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc';
5152

5253
export interface ISharedProcessConfiguration {
5354
readonly machineId: string;

src/vs/code/electron-main/app.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import { LogLevelSetterChannel } from 'vs/platform/log/node/logIpc';
5555
import * as errors from 'vs/base/common/errors';
5656
import { ElectronURLListener } from 'vs/platform/url/electron-main/electronUrlListener';
5757
import { serve as serveDriver } from 'vs/platform/driver/electron-main/driver';
58-
import { connectRemoteAgentManagement, RemoteAgentConnectionContext } from 'vs/platform/remote/node/remoteAgentConnection';
58+
import { connectRemoteAgentManagement } from 'vs/platform/remote/node/remoteAgentConnection';
5959
import { IMenubarService } from 'vs/platform/menubar/common/menubar';
6060
import { MenubarService } from 'vs/platform/menubar/electron-main/menubarService';
6161
import { MenubarChannel } from 'vs/platform/menubar/node/menubarIpc';
@@ -78,6 +78,7 @@ import { IBackupMainService } from 'vs/platform/backup/common/backup';
7878
import { HistoryMainService } from 'vs/platform/history/electron-main/historyMainService';
7979
import { URLService } from 'vs/platform/url/common/urlService';
8080
import { WorkspacesMainService } from 'vs/platform/workspaces/electron-main/workspacesMainService';
81+
import { RemoteAgentConnectionContext } from 'vs/platform/remote/common/remoteAgentEnvironment';
8182

8283
export class CodeApplication extends Disposable {
8384

src/vs/platform/dialogs/node/dialogIpc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { IChannel, IServerChannel } from 'vs/base/parts/ipc/node/ipc';
6+
import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc';
77
import { IDialogService, IConfirmation, IConfirmationResult } from 'vs/platform/dialogs/common/dialogs';
88
import Severity from 'vs/base/common/severity';
99
import { Event } from 'vs/base/common/event';

src/vs/platform/download/node/downloadIpc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { URI } from 'vs/base/common/uri';
77
import * as path from 'vs/base/common/path';
88
import * as fs from 'fs';
9-
import { IChannel, IServerChannel } from 'vs/base/parts/ipc/node/ipc';
9+
import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc';
1010
import { Event, Emitter } from 'vs/base/common/event';
1111
import { IDownloadService } from 'vs/platform/download/common/download';
1212
import { mkdirp } from 'vs/base/node/pfs';

0 commit comments

Comments
 (0)