File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
src/vs/editor/contrib/suggest Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -584,6 +584,10 @@ export class SuggestController implements IEditorContribution {
584
584
toggleSuggestionFocus ( ) : void {
585
585
this . widget . value . toggleDetailsFocus ( ) ;
586
586
}
587
+
588
+ resetWidgetSize ( ) : void {
589
+ this . widget . value . resetPersistedSize ( ) ;
590
+ }
587
591
}
588
592
589
593
export class TriggerSuggestAction extends EditorAction {
@@ -875,3 +879,20 @@ registerEditorCommand(new SuggestCommand({
875
879
primary : KeyMod . Shift | KeyCode . Tab
876
880
}
877
881
} ) ) ;
882
+
883
+
884
+ registerEditorAction ( class extends EditorAction {
885
+
886
+ constructor ( ) {
887
+ super ( {
888
+ id : 'editor.action.resetSuggestSize' ,
889
+ label : nls . localize ( 'suggest.reset.label' , "Reset Suggest Widget Size" ) ,
890
+ alias : 'Reset Suggest Widget Size' ,
891
+ precondition : undefined
892
+ } ) ;
893
+ }
894
+
895
+ run ( _accessor : ServicesAccessor , editor : ICodeEditor ) : void {
896
+ SuggestController . get ( editor ) . resetWidgetSize ( ) ;
897
+ }
898
+ } ) ;
Original file line number Diff line number Diff line change @@ -84,6 +84,10 @@ class PersistedWidgetSize {
84
84
store ( size : dom . Dimension ) {
85
85
this . _service . store ( this . _key , JSON . stringify ( size ) , StorageScope . GLOBAL ) ;
86
86
}
87
+
88
+ reset ( ) : void {
89
+ this . _service . remove ( this . _key , StorageScope . GLOBAL ) ;
90
+ }
87
91
}
88
92
89
93
export class SuggestWidget implements IDisposable {
@@ -683,6 +687,10 @@ export class SuggestWidget implements IDisposable {
683
687
}
684
688
}
685
689
690
+ resetPersistedSize ( ) : void {
691
+ this . _persistedSize . reset ( ) ;
692
+ }
693
+
686
694
hideWidget ( ) : void {
687
695
this . loadingTimeout . dispose ( ) ;
688
696
this . _setState ( State . Hidden ) ;
You can’t perform that action at this time.
0 commit comments