MCPcopy Index your code
hub / github.com/microsoft/vscode-cpptools / getSshConfigHostInfos

Function getSshConfigHostInfos

Extension/src/SSH/sshHosts.ts:45–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43
44// Map: host -> info
45export async function getSshConfigHostInfos(): Promise<Map<string, ISshConfigHostInfo>> {
46 const hostInfos: Map<string, ISshConfigHostInfo> = new Map<string, ISshConfigHostInfo>();
47
48 for (const configPath of getSshConfigurationFiles()) {
49 const config: Configuration = await getSshConfiguration(configPath);
50 const hosts: { [host: string]: string } = extractHostNames(config);
51 Object.keys(hosts).forEach(name => hostInfos.set(name, { hostName: hosts[name], file: configPath }));
52 }
53
54 return hostInfos;
55}
56
57function extractHostNames(parsedConfig: Configuration): { [host: string]: string } {
58 const hostNames: { [host: string]: string } = Object.create(null);

Callers 2

getTargetsMethod · 0.90
initializeSshTargetsFunction · 0.90

Calls 6

getSshConfigurationFilesFunction · 0.85
getSshConfigurationFunction · 0.85
extractHostNamesFunction · 0.85
keysMethod · 0.80
forEachMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected