@@ -301,6 +301,18 @@ class QuickInput implements IQuickInput {
301301 return '' ;
302302 }
303303
304+ protected showMessageDecoration ( severity : Severity ) {
305+ this . ui . inputBox . showDecoration ( severity ) ;
306+ if ( severity === Severity . Error ) {
307+ const styles = this . ui . inputBox . stylesForType ( severity ) ;
308+ this . ui . message . style . backgroundColor = styles . background ? `${ styles . background } ` : null ;
309+ this . ui . message . style . border = styles . border ? `1px solid ${ styles . border } ` : null ;
310+ } else {
311+ this . ui . message . style . backgroundColor = '' ;
312+ this . ui . message . style . border = '' ;
313+ }
314+ }
315+
304316 public dispose ( ) : void {
305317 this . hide ( ) ;
306318 this . disposables = dispose ( this . disposables ) ;
@@ -742,10 +754,10 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
742754 }
743755 if ( this . validationMessage ) {
744756 this . ui . message . textContent = this . validationMessage ;
745- this . ui . inputBox . showDecoration ( Severity . Error ) ;
757+ this . showMessageDecoration ( Severity . Error ) ;
746758 } else {
747759 this . ui . message . textContent = null ;
748- this . ui . inputBox . showDecoration ( Severity . Ignore ) ;
760+ this . showMessageDecoration ( Severity . Info ) ;
749761 }
750762 this . ui . customButton . label = this . customLabel ;
751763 this . ui . customButton . element . title = this . customHover ;
@@ -876,11 +888,11 @@ class InputBox extends QuickInput implements IInputBox {
876888 }
877889 if ( ! this . validationMessage && this . ui . message . textContent !== this . noValidationMessage ) {
878890 this . ui . message . textContent = this . noValidationMessage ;
879- this . ui . inputBox . showDecoration ( Severity . Ignore ) ;
891+ this . showMessageDecoration ( Severity . Info ) ;
880892 }
881893 if ( this . validationMessage && this . ui . message . textContent !== this . validationMessage ) {
882894 this . ui . message . textContent = this . validationMessage ;
883- this . ui . inputBox . showDecoration ( Severity . Error ) ;
895+ this . showMessageDecoration ( Severity . Error ) ;
884896 }
885897 this . ui . setVisibilities ( { title : ! ! this . title || ! ! this . step , inputBox : true , message : true } ) ;
886898 }
@@ -1044,7 +1056,8 @@ export class QuickInputService extends Component implements IQuickInputService {
10441056 }
10451057 } ) ) ;
10461058
1047- this . filterContainer = dom . append ( headerContainer , $ ( '.quick-input-filter' ) ) ;
1059+ const extraContainer = dom . append ( headerContainer , $ ( '.quick-input-and-message' ) ) ;
1060+ this . filterContainer = dom . append ( extraContainer , $ ( '.quick-input-filter' ) ) ;
10481061
10491062 const inputBox = this . _register ( new QuickInputBox ( this . filterContainer ) ) ;
10501063 inputBox . setAttribute ( 'aria-describedby' , `${ this . idPrefix } message` ) ;
@@ -1075,7 +1088,7 @@ export class QuickInputService extends Component implements IQuickInputService {
10751088 this . onDidCustomEmitter . fire ( ) ;
10761089 } ) ) ;
10771090
1078- const message = dom . append ( container , $ ( `#${ this . idPrefix } message.quick-input-message` ) ) ;
1091+ const message = dom . append ( extraContainer , $ ( `#${ this . idPrefix } message.quick-input-message` ) ) ;
10791092
10801093 const progressBar = new ProgressBar ( container ) ;
10811094 dom . addClass ( progressBar . getContainer ( ) , 'quick-input-progress' ) ;
0 commit comments