From 4b601b0fcf42ad199e9398cdaf70a0a54d6969b3 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 30 Oct 2024 15:00:32 +0100 Subject: [PATCH] use workspace storage location instead of global storage location (#232596) --- .../vscode-selfhost-test-provider/src/extension.ts | 9 +++++---- .../vscode-selfhost-test-provider/src/failureTracker.ts | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.vscode/extensions/vscode-selfhost-test-provider/src/extension.ts b/.vscode/extensions/vscode-selfhost-test-provider/src/extension.ts index 2732ef3b3f6..cbb8d50bf99 100644 --- a/.vscode/extensions/vscode-selfhost-test-provider/src/extension.ts +++ b/.vscode/extensions/vscode-selfhost-test-provider/src/extension.ts @@ -86,10 +86,11 @@ export async function activate(context: vscode.ExtensionContext) { }, uri => ctrl.items.get(uri.toString().toLowerCase())); ctrl.relatedCodeProvider = graph; - context.subscriptions.push( - new FailureTracker(context, folder.uri.fsPath), - fileChangedEmitter.event(e => graph.didChange(e.uri, e.removed)), - ); + if (context.storageUri) { + context.subscriptions.push(new FailureTracker(context.storageUri.fsPath, folder.uri.fsPath)); + } + + context.subscriptions.push(fileChangedEmitter.event(e => graph.didChange(e.uri, e.removed))); }); const createRunHandler = ( diff --git a/.vscode/extensions/vscode-selfhost-test-provider/src/failureTracker.ts b/.vscode/extensions/vscode-selfhost-test-provider/src/failureTracker.ts index e04d4beede4..5bed5dd63e3 100644 --- a/.vscode/extensions/vscode-selfhost-test-provider/src/failureTracker.ts +++ b/.vscode/extensions/vscode-selfhost-test-provider/src/failureTracker.ts @@ -33,8 +33,8 @@ export class FailureTracker { private readonly logFile: string; private logs?: ITrackedRemediation[]; - constructor(context: vscode.ExtensionContext, private readonly rootDir: string) { - this.logFile = join(context.globalStorageUri.fsPath, '.build/vscode-test-failures.json'); + constructor(storageLocation: string, private readonly rootDir: string) { + this.logFile = join(storageLocation, '.build/vscode-test-failures.json'); mkdirSync(dirname(this.logFile), { recursive: true }); const oldLogFile = join(rootDir, '.build/vscode-test-failures.json');