self.SourcesTestRunner=self.SourcesTestRunner||{},SourcesTestRunner.dumpSuggestions=function(e,t){let o;const n=new Promise((e=>{o=e}));let r,s=-1;for(let i=0;i<t.length;++i)if(r=t[i].indexOf("|"),-1!==r){s=i;break}if(-1===s)throw new Error("Test case is invalid: cursor position is not marked with '|' symbol.");return e.setText(t.join("\n").replace("|","")),e.setSelection(TextUtils.TextRange.createFromLocation(s,r)),TestRunner.addSniffer(TextEditor.TextEditorAutocompleteController.prototype,"_onSuggestionsShownForTest",(function(t){TestRunner.addResult("========= Selection In Editor ========="),SourcesTestRunner.dumpTextWithSelection(e),TestRunner.addResult("======= Autocomplete Suggestions ======="),TestRunner.addResult("["+t.map((e=>e.text)).join(", ")+"]"),o()})),e._autocompleteController.autocomplete(),n};