From 80dfe4ba69eb1b856013428627602c3c3c283e00 Mon Sep 17 00:00:00 2001 From: Elena Tanasoiu Date: Mon, 16 Jan 2023 15:49:53 +0000 Subject: [PATCH] Rename slurpQueryHistory -> deserializeQueryHistory --- extensions/ql-vscode/src/legacy-query-server/run-queries.ts | 2 +- extensions/ql-vscode/src/query-history.ts | 6 ++++-- extensions/ql-vscode/src/query-results.ts | 4 ++-- extensions/ql-vscode/src/query-serialization.ts | 2 +- extensions/ql-vscode/src/run-queries-shared.ts | 2 +- .../test/vscode-tests/no-workspace/query-results.test.ts | 6 +++--- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/extensions/ql-vscode/src/legacy-query-server/run-queries.ts b/extensions/ql-vscode/src/legacy-query-server/run-queries.ts index c5eda0518..09bb79f18 100644 --- a/extensions/ql-vscode/src/legacy-query-server/run-queries.ts +++ b/extensions/ql-vscode/src/legacy-query-server/run-queries.ts @@ -36,7 +36,7 @@ import { QueryEvaluationInfo, QueryWithResults } from "../run-queries-shared"; export class QueryInProgress { public queryEvalInfo: QueryEvaluationInfo; /** - * Note that in the {@link slurpQueryHistory} method, we create a QueryEvaluationInfo instance + * Note that in the {@link deserializeQueryHistory} method, we create a QueryEvaluationInfo instance * by explicitly setting the prototype in order to avoid calling this constructor. */ constructor( diff --git a/extensions/ql-vscode/src/query-history.ts b/extensions/ql-vscode/src/query-history.ts index 4bd0a11cd..0dd0ad777 100644 --- a/extensions/ql-vscode/src/query-history.ts +++ b/extensions/ql-vscode/src/query-history.ts @@ -48,7 +48,7 @@ import { variantAnalysisStatusToQueryStatus, } from "./query-status"; import { - slurpQueryHistory, + deserializeQueryHistory, serializeQueryHistory, } from "./query-serialization"; import { pathExists } from "fs-extra"; @@ -790,7 +790,9 @@ export class QueryHistoryManager extends DisposableObject { void extLogger.log( `Reading cached query history from '${this.queryMetadataStorageLocation}'.`, ); - const history = await slurpQueryHistory(this.queryMetadataStorageLocation); + const history = await deserializeQueryHistory( + this.queryMetadataStorageLocation, + ); this.treeDataProvider.allHistory = history; await Promise.all( this.treeDataProvider.allHistory.map(async (item) => { diff --git a/extensions/ql-vscode/src/query-results.ts b/extensions/ql-vscode/src/query-results.ts index b67b99c1f..c9f3f2d93 100644 --- a/extensions/ql-vscode/src/query-results.ts +++ b/extensions/ql-vscode/src/query-results.ts @@ -75,7 +75,7 @@ export class CompletedQueryInfo implements QueryWithResults { interpretedResultsSortState: InterpretedResultsSortState | undefined; /** - * Note that in the {@link slurpQueryHistory} method, we create a CompletedQueryInfo instance + * Note that in the {@link deserializeQueryHistory} method, we create a CompletedQueryInfo instance * by explicitly setting the prototype in order to avoid calling this constructor. */ constructor(evaluation: QueryWithResults) { @@ -233,7 +233,7 @@ export class LocalQueryInfo { public evalLogSummarySymbolsLocation: string | undefined; /** - * Note that in the {@link slurpQueryHistory} method, we create a FullQueryInfo instance + * Note that in the {@link deserializeQueryHistory} method, we create a FullQueryInfo instance * by explicitly setting the prototype in order to avoid calling this constructor. */ constructor( diff --git a/extensions/ql-vscode/src/query-serialization.ts b/extensions/ql-vscode/src/query-serialization.ts index 7363a55b1..42f1e1551 100644 --- a/extensions/ql-vscode/src/query-serialization.ts +++ b/extensions/ql-vscode/src/query-serialization.ts @@ -13,7 +13,7 @@ import { QueryStatus } from "./query-status"; import { QueryEvaluationInfo } from "./run-queries-shared"; import { QueryResultType } from "./pure/legacy-messages"; -export async function slurpQueryHistory( +export async function deserializeQueryHistory( fsPath: string, ): Promise { try { diff --git a/extensions/ql-vscode/src/run-queries-shared.ts b/extensions/ql-vscode/src/run-queries-shared.ts index 28e40752b..2121baf62 100644 --- a/extensions/ql-vscode/src/run-queries-shared.ts +++ b/extensions/ql-vscode/src/run-queries-shared.ts @@ -68,7 +68,7 @@ function findQueryEvalLogEndSummaryFile(resultPath: string): string { export class QueryEvaluationInfo { /** - * Note that in the {@link slurpQueryHistory} method, we create a QueryEvaluationInfo instance + * Note that in the {@link deserializeQueryHistory} method, we create a QueryEvaluationInfo instance * by explicitly setting the prototype in order to avoid calling this constructor. */ constructor( diff --git a/extensions/ql-vscode/test/vscode-tests/no-workspace/query-results.test.ts b/extensions/ql-vscode/test/vscode-tests/no-workspace/query-results.test.ts index c39e8b08b..e5f806bc1 100644 --- a/extensions/ql-vscode/test/vscode-tests/no-workspace/query-results.test.ts +++ b/extensions/ql-vscode/test/vscode-tests/no-workspace/query-results.test.ts @@ -22,7 +22,7 @@ import { CodeQLCliServer, SourceInfo } from "../../../src/cli"; import { CancellationTokenSource, Uri } from "vscode"; import { tmpDir } from "../../../src/helpers"; import { - slurpQueryHistory, + deserializeQueryHistory, serializeQueryHistory, } from "../../../src/query-serialization"; import { @@ -500,7 +500,7 @@ describe("query-results", () => { // splat and slurp await serializeQueryHistory(allHistory, allHistoryPath); - const allHistoryActual = await slurpQueryHistory(allHistoryPath); + const allHistoryActual = await deserializeQueryHistory(allHistoryPath); // the dispose methods will be different. Ignore them. allHistoryActual.forEach((info) => { @@ -543,7 +543,7 @@ describe("query-results", () => { "utf8", ); - const allHistoryActual = await slurpQueryHistory(badPath); + const allHistoryActual = await deserializeQueryHistory(badPath); // version number is invalid. Should return an empty array. expect(allHistoryActual).toEqual([]); });