Skip to content

Commit 31cfaeb

Browse files
committed
Ensure database sources are zipped on re-import
1 parent fe957db commit 31cfaeb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

extensions/ql-vscode/src/databases/database-fetcher.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,9 @@ function isFile(databaseUrl: string) {
666666
*
667667
* @param databasePath The full path to the unzipped database
668668
*/
669-
async function ensureZippedSourceLocation(databasePath: string): Promise<void> {
669+
export async function ensureZippedSourceLocation(
670+
databasePath: string,
671+
): Promise<void> {
670672
const srcFolderPath = join(databasePath, "src");
671673
const srcZipPath = `${srcFolderPath}.zip`;
672674

extensions/ql-vscode/src/databases/local-databases/database-manager.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import { DatabaseResolver } from "./database-resolver";
4343
import { telemetryListener } from "../../common/vscode/telemetry";
4444
import type { LanguageContextStore } from "../../language-context-store";
4545
import type { DatabaseOrigin } from "./database-origin";
46+
import { ensureZippedSourceLocation } from "../database-fetcher";
4647

4748
/**
4849
* The name of the key in the workspaceState dictionary in which we
@@ -260,6 +261,7 @@ export class DatabaseManager extends DisposableObject {
260261

261262
await this.removeDatabaseItem(dbItem);
262263
await copy(dbItem.origin.path, databaseUri.fsPath);
264+
await ensureZippedSourceLocation(databaseUri.fsPath);
263265
const newDbItem = new DatabaseItemImpl(databaseUri, dbItem.contents, {
264266
dateAdded: Date.now(),
265267
language: dbItem.language,

0 commit comments

Comments
 (0)