Skip to content

Commit 70cca74

Browse files
authored
Fix scope for state variable that guards the silent scan for kits (#1239)
Fix scope for state variable that guards the silent scan for kits (from workspace to global) to avoid unnecessary scanning for every folder.
1 parent fe1f910 commit 70cca74

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/kit.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -975,13 +975,14 @@ export async function scanForKits(opt?: KitScanOptions) {
975975

976976
// Rescan if the kits versions (extension context state var versus value defined for this release) don't match.
977977
export async function scanForKitsIfNeeded(context: vscode.ExtensionContext) : Promise<void> {
978-
const kitsVersionSaved = context.workspaceState.get<number>('kitsVersionSaved');
978+
const kitsVersionSaved = context.globalState.get<number>('kitsVersionSaved');
979979
const kitsVersionCurrent = 1;
980980

981981
// Scan also when there is no kits version saved in the state.
982-
if (!kitsVersionSaved || kitsVersionSaved !== kitsVersionCurrent) {
982+
if ((!kitsVersionSaved || kitsVersionSaved !== kitsVersionCurrent) &&
983+
process.env['CMT_TESTING'] !== '1') {
983984
await scanForKits();
984-
context.workspaceState.update('kitsVersionSaved', kitsVersionCurrent);
985+
context.globalState.update('kitsVersionSaved', kitsVersionCurrent);
985986
}
986987
}
987988

0 commit comments

Comments
 (0)