<commit_before>﻿using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.ExtensionsExplorer;

namespace NuPack.Dialog.Providers {
    internal class OnlinePackagesSearchNode : OnlinePackagesTreeBase {
        #region Private Members
        private string SearchText { get; set; }
        #endregion

        #region Constructors

        /// <summary>
        /// Constructor - requires provider
        /// </summary>
        /// <param name="provider">Instance of IVsTemplateProvider</param>
        public OnlinePackagesSearchNode(OnlinePackagesProvider provider, IPackageRepository repository, IVsExtensionsTreeNode parent, string searchText) :
            base(repository, parent, provider) {
            this.SearchText = searchText;

            // Mark this node as a SearchResults node to assist navigation in ExtensionsExplorer
            this.IsSearchResultsNode = true;
        }

        #endregion

        public override string Name {
            get {
                return "Search Results";
            }
        }

        protected override IQueryable<Package> PreviewQuery(IQueryable<Package> query) {
            query = query.Where(p => (p.Description != null && p.Description.ToUpper().Contains(SearchText.ToUpper())) 
                || (p.Id != null && p.Id.ToUpper().Contains(SearchText.ToUpper())));
            return query;
        }

        protected override void FillNodes(IList<IVsExtensionsTreeNode> nodes) {
            // Do nothing since this node will not have any child nodes
        }
    }
}
<commit_msg>Changed Package to IPackage in package dialog search<commit_after>﻿using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.ExtensionsExplorer;

namespace NuPack.Dialog.Providers {
    internal class OnlinePackagesSearchNode : OnlinePackagesTreeBase {
        #region Private Members
        private string SearchText { get; set; }
        #endregion

        #region Constructors

        /// <summary>
        /// Constructor - requires provider
        /// </summary>
        /// <param name="provider">Instance of IVsTemplateProvider</param>
        public OnlinePackagesSearchNode(OnlinePackagesProvider provider, IPackageRepository repository, IVsExtensionsTreeNode parent, string searchText) :
            base(repository, parent, provider) {
            this.SearchText = searchText;

            // Mark this node as a SearchResults node to assist navigation in ExtensionsExplorer
            this.IsSearchResultsNode = true;
        }

        #endregion

        public override string Name {
            get {
                return "Search Results";
            }
        }

        protected override IQueryable<IPackage> PreviewQuery(IQueryable<IPackage> query) {
            query = query.Where(p => (p.Description != null && p.Description.ToUpper().Contains(SearchText.ToUpper())) 
                || (p.Id != null && p.Id.ToUpper().Contains(SearchText.ToUpper())));
            return query;
        }

        protected override void FillNodes(IList<IVsExtensionsTreeNode> nodes) {
            // Do nothing since this node will not have any child nodes
        }
    }
}

{'fraction_non_alphanumeric': 0.08544400366188587, 'fraction_numerical': 0.0, 'mean_word_length': 2.1949317738791425, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3874429', 'n_tokens_mistral': 817, 'n_tokens_neox': 769, 'n_words': 207}