Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Dec 20, 2024
1 parent eda2e0a commit cea1231
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
5 changes: 2 additions & 3 deletions clients/vscode/src/chat/fileContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,9 @@ async function showUntitledNotebookCellContext(uri: Uri) {
const notebookEditor = await window.showNotebookDocument(notebookDocument);
const targetCell = notebookDocument.getCells().find((cell) => cell.document.uri.toString() === uri.toString());
if (notebookEditor && targetCell) {
const cellIndex = targetCell.index
const cellIndex = targetCell.index;
// FIXME(@jueliang) set selection
notebookEditor.revealRange(new NotebookRange(cellIndex, cellIndex), NotebookEditorRevealType.InCenter)

notebookEditor.revealRange(new NotebookRange(cellIndex, cellIndex), NotebookEditorRevealType.InCenter);
} else {
throw new Error(`Cell not found in notebook: ${uri.toString()}`);
}
Expand Down
2 changes: 1 addition & 1 deletion clients/vscode/src/chat/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ export function parseVscodeNotebookCellURI(uri: Uri) {
handle,
scheme,
};
}
}
6 changes: 5 additions & 1 deletion ee/tabby-ui/components/chat/chat-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ import { updateEnableActiveSelection } from '@/lib/stores/chat-actions'
import { useChatStore } from '@/lib/stores/chat-store'
import { useMutation } from '@/lib/tabby/gql'
import { setThreadPersistedMutation } from '@/lib/tabby/query'
import { cn, getTitleFromMessages, resolveFileNameForDisplay } from '@/lib/utils'
import {
cn,
getTitleFromMessages,
resolveFileNameForDisplay
} from '@/lib/utils'
import { Badge } from '@/components/ui/badge'
import { Button } from '@/components/ui/button'
import {
Expand Down
9 changes: 5 additions & 4 deletions ee/tabby-ui/components/chat/code-references.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { forwardRef, useEffect, useState } from 'react'
import { isNil } from 'lodash-es'

import { VSCODE_NOTEBOOK_CELL_SCHEME } from '@/lib/constants'
import { RelevantCodeContext } from '@/lib/types'
import { cn, resolveFileNameForDisplay } from '@/lib/utils'
import {
Expand All @@ -16,7 +17,6 @@ import {
AccordionTrigger
} from '../ui/accordion'
import { IconExternalLink, IconFile, IconFileSearch2 } from '../ui/icons'
import { VSCODE_NOTEBOOK_CELL_SCHEME } from '@/lib/constants'

interface ContextReferencesProps {
isInEditor?: boolean
Expand Down Expand Up @@ -86,8 +86,9 @@ export const CodeReferences = forwardRef<
<AccordionTrigger
className={cn('my-0 py-2 font-semibold', triggerClassname)}
>
<span className="mr-2">{`Read ${totalContextLength} file${isMultipleReferences ? 's' : ''
}`}</span>
<span className="mr-2">{`Read ${totalContextLength} file${
isMultipleReferences ? 's' : ''
}`}</span>
</AccordionTrigger>
<AccordionContent className="space-y-2">
{clientContexts?.map((item, index) => {
Expand Down Expand Up @@ -178,7 +179,7 @@ function ContextItem({
<div className="flex items-center gap-1 overflow-hidden">
<IconFile className="shrink-0" />
<div className="flex-1 truncate" title={context.filepath}>
<span>{resolveFileNameForDisplay(context.filepath)}</span>
<span>{resolveFileNameForDisplay(context.filepath)}</span>
{context.range?.start && (
<span className="text-muted-foreground">
:{context.range.start}
Expand Down
2 changes: 1 addition & 1 deletion ee/tabby-ui/lib/utils/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
} from '@/lib/gql/generates/graphql'
import { MentionAttributes } from '@/lib/types'

import { MARKDOWN_SOURCE_REGEX } from '../constants/regex'
import { VSCODE_NOTEBOOK_CELL_SCHEME } from '../constants'
import { MARKDOWN_SOURCE_REGEX } from '../constants/regex'

export const isCodeSourceContext = (kind: ContextSourceKind) => {
return [
Expand Down

0 comments on commit cea1231

Please sign in to comment.