Update ee/tabby-ui/components/prompt-form.tsx

Co-authored-by: Meng Zhang <meng@tabbyml.com>
feat-adding-an-auto-completion-component
aliang 2023-11-06 14:56:58 +08:00 committed by GitHub
parent 10a2ea2afd
commit ad17668534
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -57,9 +57,10 @@ export function PromptForm({
const end = e.target?.selectionEnd ?? 0
const queryname = getSearchCompletionQueryName(value, end)
if (queryname) {
let url = `/v1beta/search?q=name:${queryname}`
const query = encodeURIComponent(`name:${queryname} kind:function`)
const url = `/v1beta/search?q=${query}`
latestFetchKey.current = url
setQueryCompletionUrl(`/v1beta/search?q=name:${queryname}`)
setQueryCompletionUrl(url)
} else {
setOptions([])
}