@@ -45,6 +45,10 @@ import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
4545
4646const expandSuggestionDocsByDefault = false ;
4747
48+ const READ_MORE_TEXT = nls . localize ( 'suggestWidget.readMore' , 'Read more... (⌃Space)' ) ;
49+ const READ_LESS_TEXT = nls . localize ( 'suggestWidget.readLess' , 'Read less... (⌃Space)' ) ;
50+ const INSERT_REPLACE_TEXT = nls . localize ( 'suggestWidget.insertOrReplace' , 'Enter to insert, Tab to replace' ) ;
51+
4852interface ISuggestionTemplateData {
4953 root : HTMLElement ;
5054
@@ -554,8 +558,8 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl
554558 this . statusBarLeftSpan = append ( this . statusBarElement , $ ( 'span' ) ) ;
555559 this . statusBarRightSpan = append ( this . statusBarElement , $ ( 'span' ) ) ;
556560
557- this . statusBarLeftSpan . innerText = 'Enter to insert, Tab to replace' ;
558- this . statusBarRightSpan . innerText = 'Read more... (⌃Space)' ;
561+ this . setStatusBarLeftText ( INSERT_REPLACE_TEXT ) ;
562+ this . setStatusBarRightText ( '' ) ;
559563
560564 this . details = instantiationService . createInstance ( SuggestionDetails , this . element , this , this . editor , markdownRenderer , triggerKeybindingLabel ) ;
561565
@@ -761,6 +765,16 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl
761765 removeClass ( this . element , 'docs-side' ) ;
762766 }
763767
768+ if ( canExpandCompletionItem ( this . focusedItem ) ) {
769+ if ( this . expandDocsSettingFromStorage ( ) ) {
770+ this . setStatusBarRightText ( READ_LESS_TEXT ) ;
771+ } else {
772+ this . setStatusBarRightText ( READ_MORE_TEXT ) ;
773+ }
774+ } else {
775+ this . statusBarRightSpan . innerText = '' ;
776+ }
777+
764778 this . editor . setAriaOptions ( { activeDescendant : getAriaId ( index ) } ) ;
765779 } ) . catch ( onUnexpectedError ) ;
766780 }
@@ -1030,6 +1044,7 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl
10301044 removeClass ( this . element , 'docs-side' ) ;
10311045 removeClass ( this . element , 'docs-below' ) ;
10321046 this . editor . layoutContentWidget ( this ) ;
1047+ this . setStatusBarRightText ( READ_MORE_TEXT ) ;
10331048 this . telemetryService . publicLog2 ( 'suggestWidget:collapseDetails' ) ;
10341049 } else {
10351050 if ( this . state !== State . Open && this . state !== State . Details && this . state !== State . Frozen ) {
@@ -1038,6 +1053,7 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl
10381053
10391054 this . updateExpandDocsSetting ( true ) ;
10401055 this . showDetails ( false ) ;
1056+ this . setStatusBarRightText ( READ_LESS_TEXT ) ;
10411057 this . telemetryService . publicLog2 ( 'suggestWidget:expandDetails' ) ;
10421058 }
10431059 }
@@ -1243,6 +1259,14 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl
12431259 this . storageService . store ( 'expandSuggestionDocs' , value , StorageScope . GLOBAL ) ;
12441260 }
12451261
1262+ private setStatusBarLeftText ( s : string ) {
1263+ this . statusBarLeftSpan . innerText = s ;
1264+ }
1265+
1266+ private setStatusBarRightText ( s : string ) {
1267+ this . statusBarRightSpan . innerText = s ;
1268+ }
1269+
12461270 dispose ( ) : void {
12471271 this . details . dispose ( ) ;
12481272 this . list . dispose ( ) ;
0 commit comments