From 5890f03a7041df5d67a97ce6c6caa159373ee173 Mon Sep 17 00:00:00 2001 From: jeanp413 Date: Wed, 11 Mar 2020 05:09:19 -0500 Subject: [PATCH] :lipstick: --- .../contrib/remote/browser/tunnelView.ts | 35 +++++++------------ 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/src/vs/workbench/contrib/remote/browser/tunnelView.ts b/src/vs/workbench/contrib/remote/browser/tunnelView.ts index 949faefeb3c..ae1bac984fd 100644 --- a/src/vs/workbench/contrib/remote/browser/tunnelView.ts +++ b/src/vs/workbench/contrib/remote/browser/tunnelView.ts @@ -657,6 +657,17 @@ export class TunnelPanelDescriptor implements IViewDescriptor { } } +function validationMessage(validationString: string | null): { content: string, severity: Severity } | null { + if (!validationString) { + return null; + } + + return { + content: validationString, + severity: Severity.Error + }; +} + namespace LabelTunnelAction { export const ID = 'remote.tunnel.label'; export const LABEL = nls.localize('remote.tunnel.label', "Set Label"); @@ -733,17 +744,7 @@ namespace ForwardPortAction { } remoteExplorerService.setEditable(undefined, null); }, - validationMessage: (value) => { - const validationString = validateInput(value); - if (!validationString) { - return null; - } - - return { - content: validationString, - severity: Severity.Error - }; - }, + validationMessage: (value) => validationMessage(validateInput(value)), placeholder: forwardPrompt }); } @@ -926,17 +927,7 @@ namespace ChangeLocalPortAction { } } }, - validationMessage: (value) => { - const validationString = validateInput(value); - if (!validationString) { - return null; - } - - return { - content: validationString, - severity: Severity.Error - }; - }, + validationMessage: (value) => validationMessage(validateInput(value)), placeholder: nls.localize('remote.tunnelsView.changePort', "New local port") }); } -- GitLab