Skip to content

Commit 40f2a58

Browse files
authored
Show the devcontainer label value specified in portsAttributes within the port notification instead of "your application" (#200667)
Fixes #192684
1 parent dc3b949 commit 40f2a58

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/vs/workbench/contrib/remote/browser/remoteExplorer.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,11 @@ class OnAutoForwardedAction extends Disposable {
385385
});
386386
}
387387

388-
private basicMessage(tunnel: RemoteTunnel) {
389-
return nls.localize('remote.tunnelsView.automaticForward', "Your application running on port {0} is available. ",
388+
private async basicMessage(tunnel: RemoteTunnel) {
389+
const properties = await this.remoteExplorerService.tunnelModel.getAttributes([{ host: tunnel.tunnelRemoteHost, port: tunnel.tunnelRemotePort }], false);
390+
const label = properties?.get(tunnel.tunnelRemotePort)?.label;
391+
return nls.localize('remote.tunnelsView.automaticForward', "Your application{0} running on port {1} is available. ",
392+
label ? ` (${label})` : '',
390393
tunnel.tunnelRemotePort);
391394
}
392395

@@ -402,7 +405,7 @@ class OnAutoForwardedAction extends Disposable {
402405
}
403406

404407
this.lastNotification?.close();
405-
let message = this.basicMessage(tunnel);
408+
let message = await this.basicMessage(tunnel);
406409
const choices = [this.openBrowserChoice(tunnel)];
407410
if (!isWeb || openPreviewEnabledContext.getValue(this.contextKeyService)) {
408411
choices.push(this.openPreviewChoice(tunnel));
@@ -481,7 +484,7 @@ class OnAutoForwardedAction extends Disposable {
481484
this.lastNotification?.close();
482485
this.lastShownPort = newTunnel.tunnelRemotePort;
483486
this.lastNotification = this.notificationService.prompt(Severity.Info,
484-
this.basicMessage(newTunnel) + this.linkMessage(),
487+
await this.basicMessage(newTunnel) + this.linkMessage(),
485488
[this.openBrowserChoice(newTunnel), this.openPreviewChoice(tunnel)],
486489
{ neverShowAgain: { id: 'remote.tunnelsView.autoForwardNeverShow', isSecondary: true } });
487490
this.lastNotification.onDidClose(() => {

0 commit comments

Comments
 (0)