Ensure database sources are zipped on re-import

This commit is contained in:
Andrew Eisenberg 2024-03-17 11:51:58 -07:00
Родитель fe957db17a
Коммит 31cfaebb59
2 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -666,7 +666,9 @@ function isFile(databaseUrl: string) {
*
* @param databasePath The full path to the unzipped database
*/
async function ensureZippedSourceLocation(databasePath: string): Promise<void> {
export async function ensureZippedSourceLocation(
databasePath: string,
): Promise<void> {
const srcFolderPath = join(databasePath, "src");
const srcZipPath = `${srcFolderPath}.zip`;

Просмотреть файл

@ -43,6 +43,7 @@ import { DatabaseResolver } from "./database-resolver";
import { telemetryListener } from "../../common/vscode/telemetry";
import type { LanguageContextStore } from "../../language-context-store";
import type { DatabaseOrigin } from "./database-origin";
import { ensureZippedSourceLocation } from "../database-fetcher";
/**
* The name of the key in the workspaceState dictionary in which we
@ -260,6 +261,7 @@ export class DatabaseManager extends DisposableObject {
await this.removeDatabaseItem(dbItem);
await copy(dbItem.origin.path, databaseUri.fsPath);
await ensureZippedSourceLocation(databaseUri.fsPath);
const newDbItem = new DatabaseItemImpl(databaseUri, dbItem.contents, {
dateAdded: Date.now(),
language: dbItem.language,