Skip to content

Commit

Permalink
update: revert
Browse files Browse the repository at this point in the history
  • Loading branch information
liangfung committed Dec 18, 2024
1 parent 69c9d2e commit c1af81e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
32 changes: 1 addition & 31 deletions clients/vscode/src/chat/WebviewHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
commands,
Location,
LocationLink,
workspace,
} from "vscode";
import type {
ServerApi,
Expand All @@ -24,7 +23,6 @@ import type {
LookupSymbolHint,
SymbolInfo,
FileLocation,
GitRepoInfo,
} from "tabby-chat-panel";
import { TABBY_CHAT_PANEL_API_VERSION } from "tabby-chat-panel";
import hashObject from "object-hash";
Expand All @@ -35,7 +33,7 @@ import { GitProvider } from "../git/GitProvider";
import { createClient } from "./chatPanel";
import { Client as LspClient } from "../lsp/Client";
import { isBrowser } from "../env";
import { getFileContextFromSelection, showFileContext, openTextDocument, buildFilePathParams } from "./fileContext";
import { getFileContextFromSelection, showFileContext, openTextDocument } from "./fileContext";
import {
localUriToChatPanelFilepath,
chatPanelFilepathToLocalUri,
Expand Down Expand Up @@ -700,34 +698,6 @@ export class WebviewHelper {
return false;
}
},
provideWorkspaceGitRepoInfo: async (): Promise<GitRepoInfo[]> => {
const activeTextEditor = window.activeTextEditor;
const infoList: GitRepoInfo[] = [];
let activeGitUrl: string | undefined;
if (activeTextEditor) {
const pathParams = await buildFilePathParams(activeTextEditor.document.uri, this.gitProvider);
if (pathParams.gitRemoteUrl) {
activeGitUrl = pathParams.gitRemoteUrl;
infoList.push({
gitUrl: activeGitUrl,
});
}
}

const workspaceFolder = workspace.workspaceFolders || [];
for (const folder of workspaceFolder) {
const repo = this.gitProvider.getRepository(folder.uri);
if (repo) {
const gitRemoteUrl = this.gitProvider.getDefaultRemoteUrl(repo);
if (gitRemoteUrl && gitRemoteUrl !== activeGitUrl) {
infoList.push({
gitUrl: gitRemoteUrl,
});
}
}
}
return infoList;
},
});
}
}
1 change: 0 additions & 1 deletion clients/vscode/src/chat/chatPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export function createClient(webview: Webview, api: ClientApiMethods): ServerApi
onKeyboardEvent: api.onKeyboardEvent,
lookupSymbol: api.lookupSymbol,
openInEditor: api.openInEditor,
provideWorkspaceGitRepoInfo: api.provideWorkspaceGitRepoInfo,
},
});
}

0 comments on commit c1af81e

Please sign in to comment.