(parsedConfig: Configuration)
| 55 | } |
| 56 | |
| 57 | function extractHostNames(parsedConfig: Configuration): { [host: string]: string } { |
| 58 | const hostNames: { [host: string]: string } = Object.create(null); |
| 59 | |
| 60 | extractHosts(parsedConfig).forEach(host => { |
| 61 | let resolvedConfig: ResolvedConfiguration | undefined; |
| 62 | try { |
| 63 | resolvedConfig = parsedConfig.compute(host); |
| 64 | } catch { |
| 65 | getSshChannel().appendLine(localize("failed.to.find.user.info.for.SSH", |
| 66 | "Failed to find user info for SSH. This could be caused by VS Code being installed using 'snap'. Please reinstall VS Code using the 'deb' package if you are planning to use SSH features.")); |
| 67 | } |
| 68 | if (resolvedConfig?.HostName !== undefined) { |
| 69 | hostNames[host] = resolvedConfig.HostName; |
| 70 | } else { |
| 71 | hostNames[host] = host; |
| 72 | } |
| 73 | }); |
| 74 | |
| 75 | return hostNames; |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * Gets parsed SSH configuration from file. Resolves Include directives as well unless specified otherwise. |
no test coverage detected