Skip to content

Commit

Permalink
fix filtering out path-only results
Browse files Browse the repository at this point in the history
  • Loading branch information
camdencheek committed Jan 8, 2025
1 parent f46a8ec commit 682cf73
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
CODE_SEARCH_PROVIDER_URI,
type ChatMessageWithSearch,
type NLSSearchDynamicFilter,
NLSSearchFileMatch,
type NLSSearchResult,
isDefined,
} from '@sourcegraph/cody-shared'

Check failure on line 8 in vscode/webviews/chat/cells/messageCell/assistant/SearchResults.tsx

View workflow job for this annotation

GitHub Actions / build

Some named imports are only used as types.

Check failure on line 8 in vscode/webviews/chat/cells/messageCell/assistant/SearchResults.tsx

View workflow job for this annotation

GitHub Actions / build

Some named imports are only used as types.
Expand Down Expand Up @@ -66,9 +67,7 @@ export const SearchResults = ({
const totalResults = useMemo(
() =>
message.search.response?.results.results.filter(
result =>
result.__typename === 'FileMatch' &&
(result.chunkMatches?.length || result.symbols?.length)
(result): result is NLSSearchFileMatch => result.__typename === 'FileMatch'
) || [],
[message.search.response]
)
Expand Down

0 comments on commit 682cf73

Please sign in to comment.