Skip to content

Commit

Permalink
fix(vscode): navigate to code browser
Browse files Browse the repository at this point in the history
  • Loading branch information
wwayne committed May 31, 2024
1 parent 47e698a commit 6fb8cfd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion clients/vscode/src/chat/ChatViewProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ export class ChatViewProvider implements WebviewViewProvider {
this.client = createClient(webviewView, {
navigate: async (context: Context) => {
if (context?.filepath && context?.git_url) {
const url = `${context.git_url}/blob/main/${context.filepath}#L${context.range.start}-L${context.range.end}`;
const serverInfo = await this.agent.fetchServerInfo();
const filePathQuery = `redirect_filepath=${context.filepath}`
const gitUrlQuery = `redirect_git_url=${context.git_url}`
const lineQuery = `line=${context.range.start}`
const url = `${serverInfo.config.endpoint}/files?${filePathQuery}&${gitUrlQuery}&${lineQuery}`;
await env.openExternal(Uri.parse(url));
}
},
Expand Down
1 change: 0 additions & 1 deletion ee/tabby-ui/app/chat/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ export default function ChatPage() {
onLoaded={onChatLoaded}
maxWidth={maxWidth}
onCopyContent={from === 'vscode' ? onCopyContent : undefined}
isReferenceClickable={from !== 'vscode'}
/>
)
}

0 comments on commit 6fb8cfd

Please sign in to comment.