Exemple #1
0
        public IEnumerable <FileExtract> GetFileExtracts(FullPath path, IEnumerable <FilePositionSpan> spans, int maxLength)
        {
            var filename = FileSystemNameFactoryExtensions.GetProjectFileName(_fileSystemNameFactory, _projectDiscovery, path);

            if (filename.IsNull)
            {
                return(Enumerable.Empty <FileExtract>());
            }

            return(_currentFileDatabase.GetFileExtracts(filename.FileName, spans, maxLength));
        }
        public override TypedResponse Process(TypedRequest typedRequest)
        {
            var r      = (SearchDirectoryNamesRequest)typedRequest;
            var result = _searchEngine.SearchDirectoryNames(r.SearchParams);

            return(new SearchDirectoryNamesResponse {
                SearchResult = FileSystemNameFactoryExtensions.ToFlatSearchResult(_fileSystemNameFactory, result.DirectoryNames),
                HitCount = result.DirectoryNames.Count,
                TotalCount = result.TotalCount
            });
        }
Exemple #3
0
        public override TypedResponse Process(TypedRequest typedRequest)
        {
            var request       = (SearchCodeRequest)typedRequest;
            var result        = _searchEngine.SearchCode(request.SearchParams);
            var searchResults = FileSystemNameFactoryExtensions.ToFlatSearchResult(
                _fileSystemNameFactory,
                result.Entries,
                searchResult => searchResult.FileName,
                searchResult => new FilePositionsData {
                Positions = searchResult.Spans
            });

            return(new SearchCodeResponse {
                SearchResults = searchResults,
                HitCount = result.HitCount,
                TotalFileCount = result.TotalFileCount,
                SearchedFileCount = result.SearchedFileCount
            });
        }