mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-13 21:05:22 +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({
|
const { data: fileSuggestions, isLoading: _isLoadingFileSuggestions } = useQuery({
|
||||||
queryKey: ["fileSuggestions-agentic", suggestionQuery, domain, selectedRepos],
|
queryKey: ["fileSuggestions-agentic", suggestionQuery, domain, selectedRepos],
|
||||||
queryFn: () => {
|
queryFn: () => {
|
||||||
let query = `file:${suggestionQuery}`;
|
const query = [];
|
||||||
|
if (suggestionQuery.length > 0) {
|
||||||
|
query.push(`file:${suggestionQuery}`);
|
||||||
|
} else {
|
||||||
|
query.push('file:.*');
|
||||||
|
}
|
||||||
|
|
||||||
if (selectedRepos.length > 0) {
|
if (selectedRepos.length > 0) {
|
||||||
query += ` reposet:${selectedRepos.join(',')}`;
|
query.push(`reposet:${selectedRepos.join(',')}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return unwrapServiceError(search({
|
return unwrapServiceError(search({
|
||||||
query,
|
query: query.join(' '),
|
||||||
matches: 10,
|
matches: 10,
|
||||||
contextLines: 1,
|
contextLines: 1,
|
||||||
}))
|
}))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue