(request, response)
| 1045 | } |
| 1046 | |
| 1047 | var autocomplete = function(request, response) { |
| 1048 | var term = $.ui.autocomplete.escapeRegex(request.term); |
| 1049 | var rx1 = new RegExp(term, 'i'); |
| 1050 | var rx2 = new RegExp("(^|::)"+term.replace(/^:*/, ''), 'i'); |
| 1051 | var functionList = []; |
| 1052 | var k = getFnNameKey(request.term) |
| 1053 | if (k && Object.prototype.hasOwnProperty.call(functionDict,k)) { |
| 1054 | functionList = functionDict[k].filter( |
| 1055 | function(word) { return word.match(rx2) }); |
| 1056 | } |
| 1057 | var l = fileIndex.filter( function(word) { return word.match(rx1); }); |
| 1058 | l = l.concat(functionList); |
| 1059 | l = l.slice(0,1000); // too big lists are too slow |
| 1060 | response(l); |
| 1061 | }; |
| 1062 | |
| 1063 | searchline.autocomplete( {source: autocomplete, select: activate, minLength: 4 } ); |
| 1064 |
nothing calls this directly
no test coverage detected