/*public IEnumerable<ChainedNavigationItemData> GetNextChainedScopes(
         *  GotoContext gotoContext, IdentifierMatcher matcher, INavigationScope containingScope, CheckForInterrupt checkCancelled)
         * {
         *  var solution = containingScope.GetSolution();
         *  var cache = this.GetCache(containingScope, solution, gotoContext);
         *
         *  return ChainedScopesUtil.GetNextCodeModelScope(matcher, containingScope, checkCancelled, cache, true);
         * }
         */

        public IEnumerable <MatchingInfo> FindMatchingInfos(
            IdentifierMatcher matcher, INavigationScope scope, GotoContext gotoContext, Func <bool> checkCancelled)
        {
            var primaryMembersData = this.GetPrimaryMembers(scope.GetSolution());

            var fileMembersMap = new NTriplesFileMembersMap();

            var result = new Collection <MatchingInfo>();

            foreach (var data in primaryMembersData)
            {
                var quickSearchTexts = this.GetQuickSearchTexts(data.Element);
                var matchedText      = quickSearchTexts.FirstOrDefault(tuple => matcher.Matches(tuple.A));
                if (matchedText == null)
                {
                    continue;
                }

                fileMembersMap.Add(matchedText.A, data);

                var matchingIndicies = matchedText.B
                                           ? matcher.MatchingIndicies(matchedText.A)
                                           : EmptyArray <IdentifierMatch> .Instance;
                result.Add(
                    new MatchingInfo(
                        matchedText.A,
                        matcher.Filter == "*"
                            ? EmptyList <IdentifierMatch> .InstanceList
                            : matchingIndicies,
                        matchedText.B));
            }

            gotoContext.PutData(NTriplesFileMembersMap.NTriplesFileMembersMapKey, fileMembersMap);
            return(result);
        }
Esempio n. 2
0
        public IEnumerable <MatchingInfo> FindMatchingInfos(IdentifierMatcher matcher, INavigationScope scope, GotoContext gotoContext, Func <bool> checkForInterrupt)
        {
            var fileMemberScope = scope as FileMemberNavigationScope;

            if (fileMemberScope == null)
            {
                return(EmptyList <MatchingInfo> .InstanceList);
            }

            var primaryMembersData = GetPrimaryMembers(fileMemberScope);

            var psiFileMembersMap = new PsiFileMembersMap();

            var result = new Collection <MatchingInfo>();

            foreach (var data in primaryMembersData)
            {
                var quickSearchTexts = GetQuickSearchTexts(data.Element);
                var matchedText      = quickSearchTexts.FirstOrDefault(tuple => matcher.Matches(tuple.A));
                if (matchedText == null)
                {
                    continue;
                }

                psiFileMembersMap.Add(matchedText.A, data);

                var matchingIndicies = matchedText.B ? matcher.MatchingIndicies(matchedText.A) : EmptyArray <IdentifierMatch> .Instance;
                result.Add(new MatchingInfo(matchedText.A, matcher.Filter == "*" ? EmptyList <IdentifierMatch> .InstanceList : matchingIndicies, matchedText.B));
            }

            gotoContext.PutData(PsiFileMembersMap.PsiFileMembersMapKey, psiFileMembersMap);
            return(result);
        }
        /*public IEnumerable<ChainedNavigationItemData> GetNextChainedScopes(
            GotoContext gotoContext, IdentifierMatcher matcher, INavigationScope containingScope, CheckForInterrupt checkCancelled)
        {
            var solution = containingScope.GetSolution();
            var cache = this.GetCache(containingScope, solution, gotoContext);

            return ChainedScopesUtil.GetNextCodeModelScope(matcher, containingScope, checkCancelled, cache, true);
        }
*/

        public IEnumerable<MatchingInfo> FindMatchingInfos(
            IdentifierMatcher matcher, INavigationScope scope, GotoContext gotoContext, Func<bool> checkCancelled)
        {
            var primaryMembersData = this.GetPrimaryMembers(scope.GetSolution());

            var fileMembersMap = new NTriplesFileMembersMap();

            var result = new Collection<MatchingInfo>();
            foreach (var data in primaryMembersData)
            {
                var quickSearchTexts = this.GetQuickSearchTexts(data.Element);
                var matchedText = quickSearchTexts.FirstOrDefault(tuple => matcher.Matches(tuple.A));
                if (matchedText == null)
                {
                    continue;
                }

                fileMembersMap.Add(matchedText.A, data);

                var matchingIndicies = matchedText.B
                                           ? matcher.MatchingIndicies(matchedText.A)
                                           : EmptyArray<IdentifierMatch>.Instance;
                result.Add(
                    new MatchingInfo(
                        matchedText.A,
                        matcher.Filter == "*"
                            ? EmptyList<IdentifierMatch>.InstanceList
                            : matchingIndicies,
                        matchedText.B));
            }

            gotoContext.PutData(NTriplesFileMembersMap.NTriplesFileMembersMapKey, fileMembersMap);
            return result;
        }
 public override bool Matches(string filter, IdentifierMatcher matcher)
 {
   if (Parent.Matches(filter, matcher))
   {
     return true;
   }
   return matcher.Matches(FieldName);
 }
 public override bool Matches(string filter, IdentifierMatcher matcher)
 {
     if (Parent.Matches(filter, matcher))
     {
         return(true);
     }
     return(matcher.Matches(FieldName));
 }
 public override bool Matches(string filter, IdentifierMatcher matcher)
 {
     if (myFixture.Matches(filter, matcher))
     {
         return(true);
     }
     return(matcher.Matches((myMethodName)));
 }
Esempio n. 7
0
        private bool TryAddMatchingAbbreviations(IdentifierMatcher matcher,
                                                 HtmlCodeCompletionContext context, GroupedItemsCollector collector)
        {
            if (matcher == null)
            {
                return(false);
            }

            var added = false;

            foreach (var abbreviation in Abbreviations)
            {
                if (matcher.Matches(abbreviation))
                {
                    added |= AddAbbreviation(context, collector, abbreviation);
                }
            }
            return(added);
        }
Esempio n. 8
0
        public IEnumerable <MatchingInfo> FindMatchingInfos(IdentifierMatcher matcher, INavigationScope scope, CheckForInterrupt checkCancelled, GotoContext gotoContext)
        {
            var fileMemberScope = scope as FileMemberNavigationScope;

            if (fileMemberScope == null)
            {
                return(EmptyList <MatchingInfo> .InstanceList);
            }

            var primaryMembersData = GetPrimaryMembers(fileMemberScope);

            var primarySourceFile = fileMemberScope.GetPrimarySourceFile();
            ICollection <ClrFileMemberData> secondaryMembersData = new Collection <ClrFileMemberData>();

            if (scope.ExtendedSearchFlag == LibrariesFlag.SolutionAndLibraries)
            {
                var secondaryFilesGetter = fileMemberScope.GetSecondaryFilesGetter();
                secondaryMembersData = GetSecondaryMembers(primarySourceFile, secondaryFilesGetter);
            }

            var clrFileMembersMap = new ClrFileMembersMap();

            var result = new Collection <MatchingInfo>();

            foreach (var data in primaryMembersData.Concat(secondaryMembersData))
            {
                var quickSearchTexts = GetQuickSearchTexts(data.Element);
                var matchedText      = quickSearchTexts.FirstOrDefault(tuple => matcher.Matches(tuple.A));
                if (matchedText == null)
                {
                    continue;
                }

                clrFileMembersMap.Add(matchedText.A, data);

                var matchingIndicies = matchedText.B ? matcher.MatchingIndicies(matchedText.A) : EmptyArray <IdentifierMatch> .Instance;
                result.Add(new MatchingInfo(matchedText.A, matcher.Filter == "*" ? EmptyList <IdentifierMatch> .InstanceList : matchingIndicies, matchedText.B));
            }

            gotoContext.PutData(ClrFileMembersMap.ClrFileMembersMapKey, clrFileMembersMap);
            return(result);
        }
 public override bool Matches(string filter, IdentifierMatcher matcher)
 {
   return matcher.Matches(GetTypeClrName());
 }
Esempio n. 10
0
 public override bool Matches(string filter, IdentifierMatcher matcher)
 {
     return(matcher.Matches(GetTypeClrName()));
 }