diff --git a/packages/amazonq/src/util/clearCache.ts b/packages/amazonq/src/util/clearCache.ts index b516c33d43c..8c93b35ac12 100644 --- a/packages/amazonq/src/util/clearCache.ts +++ b/packages/amazonq/src/util/clearCache.ts @@ -4,7 +4,7 @@ */ import { AuthUtil } from 'aws-core-vscode/codewhisperer' -import { Commands, globals } from 'aws-core-vscode/shared' +import { Commands, fs, globals, LanguageServerResolver } from 'aws-core-vscode/shared' import vscode from 'vscode' /** @@ -40,6 +40,9 @@ async function clearCache() { await globals.globalState.clear() + // Clear the Language Server Cache + await fs.delete(LanguageServerResolver.defaultDir(), { recursive: true, force: true }) + // Make the IDE reload so all new changes take effect void vscode.commands.executeCommand('workbench.action.reloadWindow') }