diff --git a/vscode/CHANGELOG.md b/vscode/CHANGELOG.md index 8e7bb34530..db2fcd0d35 100644 --- a/vscode/CHANGELOG.md +++ b/vscode/CHANGELOG.md @@ -8,6 +8,7 @@ This is a log of all notable changes to Cody for VS Code. [Unreleased] changes a ### Fixed +- Autocomplete: Don't show loading indicator when a user is rate limited. [pull/2314](https://github.com/sourcegraph/cody/pull/2314) - Fixes an issue where the wrong rate limit count was shown. [pull/2312](https://github.com/sourcegraph/cody/pull/2312) ### Changed diff --git a/vscode/src/completions/inline-completion-item-provider.ts b/vscode/src/completions/inline-completion-item-provider.ts index a3f8eb6a5d..f46b401fc3 100644 --- a/vscode/src/completions/inline-completion-item-provider.ts +++ b/vscode/src/completions/inline-completion-item-provider.ts @@ -249,7 +249,14 @@ export class InlineCompletionItemProvider implements vscode.InlineCompletionItem let stopLoading: () => void | undefined const setIsLoading = (isLoading: boolean): void => { if (isLoading) { - stopLoading = this.config.statusBar.startLoading('Completions are being generated') + // We do not want to show a loading spinner when the user is rate limited to + // avoid visual churn. + // + // We still make the request to find out if the user is still rate limited. + const hasRateLimitError = this.config.statusBar.hasError(RateLimitError.errorName) + if (!hasRateLimitError) { + stopLoading = this.config.statusBar.startLoading('Completions are being generated') + } } else { stopLoading?.() }