Skip to content

Commit a081af8

Browse files
committed
reset uv cache
1 parent 0d6d5ae commit a081af8

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/managers/builtin/helpers.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ import { createDeferred } from '../../common/utils/deferred';
66
import { getConfiguration } from '../../common/workspace.apis';
77
import { getUvEnvironments } from './uvEnvironments';
88

9-
const available = createDeferred<boolean>();
9+
let available = createDeferred<boolean>();
10+
11+
/**
12+
* Reset the UV installation cache.
13+
*/
14+
export function resetUvInstallationCache(): void {
15+
available = createDeferred<boolean>();
16+
}
17+
1018
export async function isUvInstalled(log?: LogOutputChannel): Promise<boolean> {
1119
if (available.completed) {
1220
return available.promise;

src/test/managers/builtin/helpers.shouldUseUv.unit.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ suite('Helpers - shouldUseUv', () => {
1717
let getUvEnvironmentsStub: sinon.SinonStub;
1818

1919
setup(() => {
20+
// Reset UV installation cache before each test to ensure clean state
21+
helpers.resetUvInstallationCache();
22+
2023
getConfigurationStub = sinon.stub(workspaceApis, 'getConfiguration');
2124
mockConfig = {
2225
get: sinon.stub(),

0 commit comments

Comments
 (0)