Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxiaoys committed Apr 26, 2024
1 parent 992163b commit a6e6f88
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
21 changes: 18 additions & 3 deletions ee/tabby-ui/components/prompt-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import useSWR from 'swr'

import { useEnterSubmit } from '@/lib/hooks/use-enter-submit'
import fetcher from '@/lib/tabby/fetcher'
import type { ISearchHit, SearchReponse } from '@/lib/types'
import { cn } from '@/lib/utils'
import { Button, buttonVariants } from '@/components/ui/button'
import {
Expand Down Expand Up @@ -118,7 +117,6 @@ function PromptFormRenderer(
}, [])

const handleCompletionSelect = (item: ISearchHit) => {
/*
const selectionEnd = prevInputSelectionEnd.current ?? 0
const queryNameMatches = getSearchCompletionQueryName(input, selectionEnd)
if (queryNameMatches) {
Expand All @@ -138,7 +136,6 @@ function PromptFormRenderer(
}
setOptions([])
setSuggestionOpen(false)
*/
}

const handlePromptSubmit: React.FormEventHandler<
Expand Down Expand Up @@ -351,3 +348,21 @@ function IconForCompletionKind({
return <IconSymbolFunction {...rest} />
}
}

type ISearchHit = {
id: number
score: number
doc: {
body: string
filepath: string
git_url: string
language: string
name: string
kind: string
}
}

type SearchReponse = {
hits: Array<ISearchHit>
num_hits: number
}
1 change: 1 addition & 0 deletions ee/tabby-ui/lib/types/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export type ISearchHit = {
start_line: number
}
}

export type SearchReponse = {
hits: Array<ISearchHit>
num_hits: number
Expand Down

0 comments on commit a6e6f88

Please sign in to comment.