Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompt after turning on remote tunnel access does not display link properly #172556

Merged
merged 1 commit into from
Jan 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
if (connectionInfo) {
const linkToOpen = that.getLinkToOpen(connectionInfo);
const remoteExtension = that.serverConfiguration.extension;
const linkToOpenForMarkdown = linkToOpen.toString().replace(/\)/g, '%29');
await notificationService.notify({
severity: Severity.Info,
message:
Expand All @@ -515,11 +516,11 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
comment: ['{0} will be a host name, {1} will the link address to the web UI, {6} an extesnion name. [label](command:commandId) is a markdown link. Only translate the label, do not modify the format']
},
"Remote tunnel access is enabled for [{0}](command:{4}). To access from a different machine, open [{1}]({2}) or use the {6} extension. Use the Account menu to [configure](command:{3}) or [turn off](command:{5}).",
connectionInfo.hostName, connectionInfo.domain, linkToOpen, RemoteTunnelCommandIds.manage, RemoteTunnelCommandIds.configure, RemoteTunnelCommandIds.turnOff, remoteExtension.friendlyName
connectionInfo.hostName, connectionInfo.domain, linkToOpenForMarkdown, RemoteTunnelCommandIds.manage, RemoteTunnelCommandIds.configure, RemoteTunnelCommandIds.turnOff, remoteExtension.friendlyName
),
actions: {
primary: [
new Action('copyToClipboard', localize('action.copyToClipboard', "Copy Browser Link to Clipboard"), undefined, true, () => clipboardService.writeText(linkToOpen)),
new Action('copyToClipboard', localize('action.copyToClipboard', "Copy Browser Link to Clipboard"), undefined, true, () => clipboardService.writeText(linkToOpen.toString())),
new Action('showExtension', localize('action.showExtension', "Show Extension"), undefined, true, () => {
return commandService.executeCommand('workbench.extensions.action.showExtensionsWithIds', [remoteExtension.extensionId]);
})
Expand Down Expand Up @@ -661,7 +662,7 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
const clipboardService = accessor.get(IClipboardService);
if (that.connectionInfo) {
const linkToOpen = that.getLinkToOpen(that.connectionInfo);
clipboardService.writeText(linkToOpen);
clipboardService.writeText(linkToOpen.toString());
}

}
Expand All @@ -684,7 +685,7 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
}));
}

private getLinkToOpen(connectionInfo: ConnectionInfo): string {
private getLinkToOpen(connectionInfo: ConnectionInfo): URI {
const workspace = this.workspaceContextService.getWorkspace();
const folders = workspace.folders;
let resource;
Expand All @@ -695,9 +696,9 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
}
const link = URI.parse(connectionInfo.link);
if (resource?.scheme === Schemas.file) {
return joinPath(link, resource.path).toString(true);
return joinPath(link, resource.path);
}
return joinPath(link, this.environmentService.userHome.path).toString(true);
return joinPath(link, this.environmentService.userHome.path);
}


Expand Down