mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-11 20:05:25 +00:00
fix bug with file @ mentions
This commit is contained in:
parent
cc2837b740
commit
cbe381ad0c
1 changed files with 9 additions and 3 deletions
|
|
@ -32,13 +32,19 @@ export const useSuggestionsData = ({
|
|||
const { data: fileSuggestions, isLoading: _isLoadingFileSuggestions } = useQuery({
|
||||
queryKey: ["fileSuggestions-agentic", suggestionQuery, domain, selectedRepos],
|
||||
queryFn: () => {
|
||||
let query = `file:${suggestionQuery}`;
|
||||
const query = [];
|
||||
if (suggestionQuery.length > 0) {
|
||||
query.push(`file:${suggestionQuery}`);
|
||||
} else {
|
||||
query.push('file:.*');
|
||||
}
|
||||
|
||||
if (selectedRepos.length > 0) {
|
||||
query += ` reposet:${selectedRepos.join(',')}`;
|
||||
query.push(`reposet:${selectedRepos.join(',')}`);
|
||||
}
|
||||
|
||||
return unwrapServiceError(search({
|
||||
query,
|
||||
query: query.join(' '),
|
||||
matches: 10,
|
||||
contextLines: 1,
|
||||
}))
|
||||
|
|
|
|||
Loading…
Reference in a new issue