From 682cf733837b6dbcb11201fb89a8f489af4d3ace Mon Sep 17 00:00:00 2001 From: Camden Cheek Date: Tue, 7 Jan 2025 17:01:19 -0700 Subject: [PATCH] fix filtering out path-only results --- .../chat/cells/messageCell/assistant/SearchResults.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vscode/webviews/chat/cells/messageCell/assistant/SearchResults.tsx b/vscode/webviews/chat/cells/messageCell/assistant/SearchResults.tsx index ce9a9e65c15e..e95d37f5b2f5 100644 --- a/vscode/webviews/chat/cells/messageCell/assistant/SearchResults.tsx +++ b/vscode/webviews/chat/cells/messageCell/assistant/SearchResults.tsx @@ -2,6 +2,7 @@ import { CODE_SEARCH_PROVIDER_URI, type ChatMessageWithSearch, type NLSSearchDynamicFilter, + NLSSearchFileMatch, type NLSSearchResult, isDefined, } from '@sourcegraph/cody-shared' @@ -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] )