MCPcopy Create free account
hub / github.com/KDAB/codebrowser / autocomplete

Function autocomplete

data/indexscript.js:106–120  ·  view source on GitHub ↗
(request, response)

Source from the content-addressed store, hash-verified

104 }
105
106 var autocomplete = function(request, response) {
107 var term = $.ui.autocomplete.escapeRegex(request.term);
108 var rx1 = new RegExp(term, 'i');
109 var rx2 = new RegExp("(^|::)"+term.replace(/^:*/, ''), 'i');
110 var functionList = [];
111 var k = getFnNameKey(request.term)
112 if (k && Object.prototype.hasOwnProperty.call(functionDict,k)) {
113 functionList = functionDict[k].filter(
114 function(word) { return word.match(rx2) });
115 }
116 var l = fileIndex.filter( function(word) { return word.match(rx1); });
117 l = l.concat(functionList);
118 l = l.slice(0,1000); // too big lists are too slow
119 response(l);
120 };
121
122 searchline.autocomplete( {source: autocomplete, select: activate, minLength: 4 } );
123

Callers

nothing calls this directly

Calls 1

getFnNameKeyFunction · 0.70

Tested by

no test coverage detected