mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-11 20:05:25 +00:00
feedback
This commit is contained in:
parent
7c964d9c28
commit
ac19251cb5
3 changed files with 16 additions and 14 deletions
|
|
@ -56,7 +56,7 @@ export const SearchResultsPanel = forwardRef<SearchResultsPanelHandle, SearchRes
|
|||
scrollOffset: restoreOffset,
|
||||
measurementsCache: restoreMeasurementsCache,
|
||||
showAllMatchesMap: restoreShowAllMatchesStates,
|
||||
} = history.state as ScrollHistoryState;
|
||||
} = (history.state ?? {}) as ScrollHistoryState;
|
||||
|
||||
const [showAllMatchesMap, showAllMatchesActions] = useMap<string, boolean>(restoreShowAllMatchesStates || []);
|
||||
|
||||
|
|
|
|||
|
|
@ -42,8 +42,6 @@ export const search = (request: SearchRequest) => sew(() =>
|
|||
repoSearchScope,
|
||||
});
|
||||
|
||||
logger.debug(`zoektSearchRequest:\n${JSON.stringify(zoektSearchRequest, null, 2)}`);
|
||||
|
||||
return zoektSearch(zoektSearchRequest, prisma);
|
||||
}));
|
||||
|
||||
|
|
@ -64,8 +62,6 @@ export const streamSearch = (request: SearchRequest) => sew(() =>
|
|||
repoSearchScope,
|
||||
});
|
||||
|
||||
logger.debug(`zoektStreamSearchRequest:\n${JSON.stringify(zoektSearchRequest, null, 2)}`);
|
||||
|
||||
return zoektStreamSearch(zoektSearchRequest, prisma);
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -120,21 +120,27 @@ export const zoektSearch = async (searchRequest: ZoektGrpcSearchRequest, prisma:
|
|||
const metadata = new grpc.Metadata();
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
client.Search(searchRequest, metadata, async (error, response) => {
|
||||
client.Search(searchRequest, metadata, (error, response) => {
|
||||
if (error || !response) {
|
||||
reject(error || new Error('No response received'));
|
||||
return;
|
||||
}
|
||||
|
||||
const reposMapCache = await createReposMapForChunk(response, new Map<string | number, Repo>(), prisma);
|
||||
const { stats, files, repositoryInfo } = await transformZoektSearchResponse(response, reposMapCache);
|
||||
(async () => {
|
||||
try {
|
||||
const reposMapCache = await createReposMapForChunk(response, new Map<string | number, Repo>(), prisma);
|
||||
const { stats, files, repositoryInfo } = await transformZoektSearchResponse(response, reposMapCache);
|
||||
|
||||
resolve({
|
||||
stats,
|
||||
files,
|
||||
repositoryInfo,
|
||||
isSearchExhaustive: stats.actualMatchCount <= stats.totalMatchCount,
|
||||
} satisfies SearchResponse);
|
||||
resolve({
|
||||
stats,
|
||||
files,
|
||||
repositoryInfo,
|
||||
isSearchExhaustive: stats.totalMatchCount <= stats.actualMatchCount,
|
||||
} satisfies SearchResponse);
|
||||
} catch (err) {
|
||||
reject(err);
|
||||
}
|
||||
})();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue