Skip to content

Commit

Permalink
update: required
Browse files Browse the repository at this point in the history
  • Loading branch information
liangfung committed Jan 2, 2025
1 parent 2423a88 commit ca26c90
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions ee/tabby-ui/app/chat/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ export default function ChatPage() {
supportsReadWorkspaceGitRepoInfo,
setSupportsReadWorkspaceGitRepoInfo
] = useState(false)
const [
supportsGetActiveEditorSelection,
setSupportsGetActiveEditorSelection
] = useState(false)

const executeCommand = (command: ChatCommand) => {
if (chatRef.current) {
Expand Down Expand Up @@ -248,9 +244,6 @@ export default function ChatPage() {
server
?.hasCapability('readWorkspaceGitRepositories')
.then(setSupportsReadWorkspaceGitRepoInfo)
server
?.hasCapability('getActiveEditorSelection')
.then(setSupportsGetActiveEditorSelection)
}

checkCapabilities().then(() => {
Expand Down Expand Up @@ -309,6 +302,10 @@ export default function ChatPage() {
return server?.openExternal(url)
}

const getActiveEditorSelection = async () => {
return server?.getActiveEditorSelection() ?? null
}

const refresh = async () => {
setIsRefreshLoading(true)
await server?.refresh()
Expand Down Expand Up @@ -431,11 +428,7 @@ export default function ChatPage() {
? server?.readWorkspaceGitRepositories
: undefined
}
getActiveEditorSelection={
supportsGetActiveEditorSelection
? server?.getActiveEditorSelection
: undefined
}
getActiveEditorSelection={getActiveEditorSelection}
/>
</ErrorBoundary>
)
Expand Down

0 comments on commit ca26c90

Please sign in to comment.