in public/webpackShims/ace/ext-language_tools.js [1161:1187]
this.updateCompletions = function(keepPopupPosition) {
if (keepPopupPosition && this.base && this.completions) {
var pos = this.editor.getCursorPosition();
var prefix = this.editor.session.getTextRange({start: this.base, end: pos});
if (prefix == this.completions.filterText)
return;
this.completions.setFilter(prefix);
if (!this.completions.filtered.length)
return this.detach();
this.openPopup(this.editor, prefix, keepPopupPosition);
return;
}
this.gatherCompletions(this.editor, function(err, results) {
var matches = results && results.matches;
if (!matches || !matches.length)
return this.detach();
this.completions = new FilteredList(matches);
this.completions.setFilter(results.prefix);
var filtered = this.completions.filtered;
if (!filtered.length)
return this.detach();
if (this.autoInsert && filtered.length == 1)
return this.insertMatch(filtered[0]);
this.openPopup(this.editor, results.prefix, keepPopupPosition);
}.bind(this));
};