From 3aad545aac6e7406907d60ffe7c72336f12fa9b6 Mon Sep 17 00:00:00 2001 From: Taichi Maeda Date: Fri, 12 Apr 2024 15:17:13 +0900 Subject: [PATCH] Fixed bug where completions are not fetched when cache is disabled --- src/api/cache.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/api/cache.ts b/src/api/cache.ts index 0f5bb3c..163f2cb 100644 --- a/src/api/cache.ts +++ b/src/api/cache.ts @@ -17,8 +17,14 @@ export class MemoryCache implements APIClient { async fetchCompletions(language: string, prefix: string, suffix: string) { const { settings } = this.plugin; + if (!settings.cache.enabled) { - return; + const completions = await this.client.fetchCompletions( + language, + prefix, + suffix, + ); + return completions; } // Extra whitespaces should not affect the completions.