Skip to content

Commit e692fc7

Browse files
committed
Retain suggest docs stickyness with new editors
1 parent f317513 commit e692fc7

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/vs/editor/contrib/suggest/browser/suggestWidget.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,12 @@ export class SuggestWidget implements IContentWidget, IDelegate<ICompletionItem>
392392
this.isAuto = false;
393393
this.focusedItem = null;
394394
this.storageService = storageService;
395-
this.storageService.store('expandSuggestionDocs', expandSuggestionDocsByDefault, StorageScope.GLOBAL);
396-
if (this.storageService.get('expandSuggestionDocs', StorageScope.GLOBAL) === undefined) {
397-
this.storageServiceAvailable = false;
395+
396+
if (this.expandDocsSettingFromStorage() === undefined) {
397+
this.storageService.store('expandSuggestionDocs', expandSuggestionDocsByDefault, StorageScope.GLOBAL);
398+
if (this.expandDocsSettingFromStorage() === undefined) {
399+
this.storageServiceAvailable = false;
400+
}
398401
}
399402

400403
this.element = $('.editor-widget.suggest-widget');
@@ -1013,7 +1016,7 @@ export class SuggestWidget implements IContentWidget, IDelegate<ICompletionItem>
10131016
// Monaco Editor does not have a storage service
10141017
private expandDocsSettingFromStorage(): boolean {
10151018
if (this.storageServiceAvailable) {
1016-
return this.storageService.getBoolean('expandSuggestionDocs', StorageScope.GLOBAL, expandSuggestionDocsByDefault);
1019+
return this.storageService.getBoolean('expandSuggestionDocs', StorageScope.GLOBAL);
10171020
} else {
10181021
return this.expandSuggestionDocs;
10191022
}

0 commit comments

Comments
 (0)