src/JSUtils/Session.js
function filterWithQueryAndMatcher(hints, matcher) {
            var matchResults = $.map(hints, function (hint) {
                var searchResult = matcher.match(hint.value, query);
                if (searchResult) {
                    searchResult.value = hint.value;
                    searchResult.guess = hint.guess;
                    searchResult.type = hint.type;

                    if (hint.keyword !== undefined) {
                        searchResult.keyword = hint.keyword;
                    }

                    if (hint.literal !== undefined) {
                        searchResult.literal = hint.literal;
                    }

                    if (hint.depth !== undefined) {
                        searchResult.depth = hint.depth;
                    }

                    if (hint.doc) {
                        searchResult.doc = hint.doc;
                    }

                    if (hint.url) {
                        searchResult.url = hint.url;
                    }

                    if (!type.property && !type.showFunctionType && hint.origin &&
                            isBuiltin(hint.origin)) {
                        searchResult.builtin = 1;
                    } else {
                        searchResult.builtin = 0;
                    }
                }

                return searchResult;
            });

            return matchResults;
        }
function filterWithQueryAndMatcher(hints, matcher) {
            var matchResults = $.map(hints, function (hint) {
                var searchResult = matcher.match(hint.value, query);
                if (searchResult) {
                    searchResult.value = hint.value;
                    searchResult.guess = hint.guess;
                    searchResult.type = hint.type;

                    if (hint.keyword !== undefined) {
                        searchResult.keyword = hint.keyword;
                    }

                    if (hint.literal !== undefined) {
                        searchResult.literal = hint.literal;
                    }

                    if (hint.depth !== undefined) {
                        searchResult.depth = hint.depth;
                    }

                    if (hint.doc) {
                        searchResult.doc = hint.doc;
                    }

                    if (hint.url) {
                        searchResult.url = hint.url;
                    }

                    if (!type.property && !type.showFunctionType && hint.origin &&
                            isBuiltin(hint.origin)) {
                        searchResult.builtin = 1;
                    } else {
                        searchResult.builtin = 0;
                    }
                }

                return searchResult;
            });

            return matchResults;
        }
function filterWithQueryAndMatcher ( hints , matcher ) { var matchResults = $ . map ( hints , function ( hint ) { var searchResult = matcher . match ( hint . value , query ) ; if ( searchResult ) { searchResult . value = hint . value ; searchResult . guess = hint . guess ; searchResult . type = hint . type ; if ( hint . keyword !== undefined ) { searchResult . keyword = hint . keyword ; } if ( hint . literal !== undefined ) { searchResult . literal = hint . literal ; } if ( hint . depth !== undefined ) { searchResult . depth = hint . depth ; } if ( hint . doc ) { searchResult . doc = hint . doc ; } if ( hint . url ) { searchResult . url = hint . url ; } if ( ! type . property && ! type . showFunctionType && hint . origin && isBuiltin ( hint . origin ) ) { searchResult . builtin = 1 ; } else { searchResult . builtin = 0 ; } } return searchResult ; } ) ; return matchResults ; }
Filter an array hints using a given query and matcher.
The hints are returned in the format of the matcher.
The matcher returns the value in the "label" property,
the match score in "matchGoodness" property.

@param {Array} hints - array of hints
@param {StringMatcher} matcher
@return {Array} - array of matching hints.
Filter an array hints using a given query and matcher . The hints are returned in the format of the matcher . The matcher returns the value in the label property the match score in matchGoodness property .