Skip to content

Commit

Permalink
Make the refresh button more reliable.
Browse files Browse the repository at this point in the history
  • Loading branch information
dominiccooney committed Sep 25, 2023
1 parent 9ee5041 commit e3cbe46
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vscode/src/chat/ChatViewProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class ChatViewProvider extends MessageProvider implements vscode.WebviewV
}

private async simplifiedOnboardingReloadEmbeddingsState(): Promise<void> {
return vscode.commands.executeCommand('cody.auth.sync')
await this.contextProvider.forceUpdateCodebaseContext()
}

private async onHumanMessageSubmitted(text: string, submitType: 'user' | 'suggestion' | 'example'): Promise<void> {
Expand Down
5 changes: 5 additions & 0 deletions vscode/src/chat/ContextProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ export class ContextProvider implements vscode.Disposable {
this.configurationChangeEvent.fire()
}

public async forceUpdateCodebaseContext(): Promise<void> {
this.currentWorkspaceRoot = ''
return this.syncAuthStatus()
}

private async updateCodebaseContext(): Promise<void> {
if (!this.editor.getActiveTextEditor() && vscode.window.visibleTextEditors.length !== 0) {
// these are ephemeral
Expand Down
2 changes: 1 addition & 1 deletion vscode/src/chat/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const CODY_FEEDBACK_URL = new URL(
// APP
export const APP_LANDING_URL = new URL('https://about.sourcegraph.com/app')
export const APP_CALLBACK_URL = new URL('sourcegraph://user/settings/tokens/new/callback')
export const APP_REPOSITORIES_URL = new URL('sourcegraph:///users/admin/app-settings/local-repositories')
export const APP_REPOSITORIES_URL = new URL('sourcegraph://users/admin/app-settings/local-repositories')

/**
* The status of a users authentication, whether they're authenticated and have a
Expand Down

0 comments on commit e3cbe46

Please sign in to comment.