(request, response)
| 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 |
nothing calls this directly
no test coverage detected