Skip to content

Commit a405b0c

Browse files
committed
Pass in IRemoteAgentService to RemoteFileSystemProvider
1 parent c474863 commit a405b0c

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/vs/workbench/browser/web.main.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import { ILogService, ConsoleLogService, MultiplexLogService } from 'vs/platform
1010
import { Disposable } from 'vs/base/common/lifecycle';
1111
import { BrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService';
1212
import { Workbench } from 'vs/workbench/browser/workbench';
13-
import { IChannel } from 'vs/base/parts/ipc/common/ipc';
14-
import { REMOTE_FILE_SYSTEM_CHANNEL_NAME, RemoteFileSystemProvider } from 'vs/platform/remote/common/remoteAgentFileSystemChannel';
13+
import { RemoteFileSystemProvider } from 'vs/workbench/services/remote/common/remoteAgentFileSystemChannel';
1514
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
1615
import { IProductService } from 'vs/platform/product/common/productService';
1716
import product from 'vs/platform/product/common/product';
@@ -244,8 +243,7 @@ class BrowserMain extends Disposable {
244243
if (connection) {
245244

246245
// Remote file system
247-
const channel = connection.getChannel<IChannel>(REMOTE_FILE_SYSTEM_CHANNEL_NAME);
248-
const remoteFileSystemProvider = this._register(new RemoteFileSystemProvider(channel, remoteAgentService.getEnvironment()));
246+
const remoteFileSystemProvider = this._register(new RemoteFileSystemProvider(remoteAgentService));
249247
fileService.registerProvider(Schemas.vscodeRemote, remoteFileSystemProvider);
250248

251249
if (!this.configuration.userDataProvider) {

src/vs/workbench/electron-browser/desktop.main.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteA
4242
import { FileService } from 'vs/platform/files/common/fileService';
4343
import { IFileService } from 'vs/platform/files/common/files';
4444
import { DiskFileSystemProvider } from 'vs/platform/files/electron-browser/diskFileSystemProvider';
45-
import { IChannel } from 'vs/base/parts/ipc/common/ipc';
46-
import { REMOTE_FILE_SYSTEM_CHANNEL_NAME, RemoteFileSystemProvider } from 'vs/platform/remote/common/remoteAgentFileSystemChannel';
45+
import { RemoteFileSystemProvider } from 'vs/workbench/services/remote/common/remoteAgentFileSystemChannel';
4746
import { ConfigurationCache } from 'vs/workbench/services/configuration/node/configurationCache';
4847
import { SpdLogService } from 'vs/platform/log/node/spdlogService';
4948
import { SignService } from 'vs/platform/sign/node/signService';
@@ -216,8 +215,7 @@ class DesktopMain extends Disposable {
216215

217216
const connection = remoteAgentService.getConnection();
218217
if (connection) {
219-
const channel = connection.getChannel<IChannel>(REMOTE_FILE_SYSTEM_CHANNEL_NAME);
220-
const remoteFileSystemProvider = this._register(new RemoteFileSystemProvider(channel, remoteAgentService.getEnvironment()));
218+
const remoteFileSystemProvider = this._register(new RemoteFileSystemProvider(remoteAgentService));
221219
fileService.registerProvider(Schemas.vscodeRemote, remoteFileSystemProvider);
222220
}
223221

src/vs/platform/remote/common/remoteAgentFileSystemChannel.ts renamed to src/vs/workbench/services/remote/common/remoteAgentFileSystemChannel.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { generateUuid } from 'vs/base/common/uuid';
1010
import { IChannel } from 'vs/base/parts/ipc/common/ipc';
1111
import { FileChangeType, FileDeleteOptions, FileOverwriteOptions, FileSystemProviderCapabilities, FileType, IFileChange, IStat, IWatchOptions, FileOpenOptions, IFileSystemProviderWithFileReadWriteCapability, FileWriteOptions, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileFolderCopyCapability, FileReadStreamOptions, IFileSystemProviderWithOpenReadWriteCloseCapability } from 'vs/platform/files/common/files';
1212
import { VSBuffer } from 'vs/base/common/buffer';
13-
import { IRemoteAgentEnvironment } from 'vs/platform/remote/common/remoteAgentEnvironment';
13+
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
1414
import { OperatingSystem } from 'vs/base/common/platform';
1515
import { newWriteableStream, ReadableStreamEvents, ReadableStreamEventPayload } from 'vs/base/common/stream';
1616
import { CancellationToken } from 'vs/base/common/cancellation';
@@ -31,6 +31,7 @@ export class RemoteFileSystemProvider extends Disposable implements
3131
IFileSystemProviderWithFileFolderCopyCapability {
3232

3333
private readonly session: string = generateUuid();
34+
private readonly channel: IChannel;
3435

3536
private readonly _onDidChange = this._register(new Emitter<readonly IFileChange[]>());
3637
readonly onDidChangeFile = this._onDidChange.event;
@@ -44,11 +45,14 @@ export class RemoteFileSystemProvider extends Disposable implements
4445
private _capabilities!: FileSystemProviderCapabilities;
4546
get capabilities(): FileSystemProviderCapabilities { return this._capabilities; }
4647

47-
constructor(private readonly channel: IChannel, environment: Promise<IRemoteAgentEnvironment | null>) {
48+
constructor(remoteAgentService: IRemoteAgentService) {
4849
super();
4950

51+
const connection = remoteAgentService.getConnection()!;
52+
this.channel = connection.getChannel<IChannel>(REMOTE_FILE_SYSTEM_CHANNEL_NAME);
53+
5054
this.setCaseSensitive(true);
51-
environment.then(remoteAgentEnvironment => this.setCaseSensitive(!!(remoteAgentEnvironment && remoteAgentEnvironment.os === OperatingSystem.Linux)));
55+
remoteAgentService.getEnvironment().then(remoteAgentEnvironment => this.setCaseSensitive(!!(remoteAgentEnvironment && remoteAgentEnvironment.os === OperatingSystem.Linux)));
5256

5357
this.registerListeners();
5458
}

0 commit comments

Comments
 (0)