提交 8383d424 编写于 作者: J Joao Moreno

fix suggest widget in standalone editor

fixes Microsoft/monaco-editor#1185
fixes Microsoft/monaco-editor#1186

cc @bpasero @ramya-rao-a
上级 fdfe5099
......@@ -437,6 +437,9 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<IComp
private detailsFocusBorderColor: string;
private detailsBorderColor: string;
private storageServiceAvailable: boolean = true;
private expandSuggestionDocs: boolean = false;
private firstFocusInCurrentList: boolean = false;
constructor(
......@@ -458,6 +461,13 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<IComp
this.focusedItem = null;
this.storageService = storageService;
// :facepalm:
this.storageService.store('___suggest___', true, StorageScope.GLOBAL);
if (!this.storageService.get('___suggest___', StorageScope.GLOBAL)) {
this.storageServiceAvailable = false;
}
this.storageService.remove('___suggest___', StorageScope.GLOBAL);
this.element = $('.editor-widget.suggest-widget');
if (!this.editor.getConfiguration().contribInfo.iconsInSuggestions) {
addClass(this.element, 'no-icons');
......@@ -1083,11 +1093,19 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<IComp
}
private expandDocsSettingFromStorage(): boolean {
return this.storageService.getBoolean('expandSuggestionDocs', StorageScope.GLOBAL, expandSuggestionDocsByDefault);
if (this.storageServiceAvailable) {
return this.storageService.getBoolean('expandSuggestionDocs', StorageScope.GLOBAL, expandSuggestionDocsByDefault);
} else {
return this.expandSuggestionDocs;
}
}
private updateExpandDocsSetting(value: boolean) {
this.storageService.store('expandSuggestionDocs', value, StorageScope.GLOBAL);
if (this.storageServiceAvailable) {
this.storageService.store('expandSuggestionDocs', value, StorageScope.GLOBAL);
} else {
this.expandSuggestionDocs = value;
}
}
dispose(): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册