Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/platform/agentHost/browser/nullSshRemoteAgentHostService.ts
13394 views
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 { Event } from '../../../base/common/event.js';
7
import { URI } from '../../../base/common/uri.js';
8
import type { ISSHRemoteAgentHostService, ISSHAgentHostConnection, ISSHAgentHostConfig, ISSHConnectProgress, ISSHResolvedConfig } from '../common/sshRemoteAgentHost.js';
9
10
/**
11
* Null implementation of {@link ISSHRemoteAgentHostService} for browser contexts
12
* where SSH is not available.
13
*/
14
export class NullSSHRemoteAgentHostService implements ISSHRemoteAgentHostService {
15
declare readonly _serviceBrand: undefined;
16
readonly onDidChangeConnections = Event.None;
17
readonly onDidReportConnectProgress: Event<ISSHConnectProgress> = Event.None;
18
readonly connections: readonly ISSHAgentHostConnection[] = [];
19
20
async connect(_config: ISSHAgentHostConfig): Promise<ISSHAgentHostConnection> {
21
throw new Error('SSH connections are not supported in the browser.');
22
}
23
24
async disconnect(_host: string): Promise<void> { }
25
26
async listSSHConfigHosts(): Promise<string[]> {
27
return [];
28
}
29
30
async ensureUserSSHConfig(): Promise<URI> {
31
throw new Error('SSH is not supported in the browser.');
32
}
33
34
async listSSHConfigFiles(): Promise<URI[]> {
35
return [];
36
}
37
38
async resolveSSHConfig(_host: string): Promise<ISSHResolvedConfig> {
39
throw new Error('SSH is not supported in the browser.');
40
}
41
42
async reconnect(_sshConfigHost: string, _name: string): Promise<ISSHAgentHostConnection> {
43
throw new Error('SSH connections are not supported in the browser.');
44
}
45
}
46
47