Rename slurpQueryHistory -> deserializeQueryHistory

This commit is contained in:
Elena Tanasoiu 2023-01-16 15:49:53 +00:00
Родитель 06bc4c8fe3
Коммит 80dfe4ba69
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 865B598BB92245B0
6 изменённых файлов: 12 добавлений и 10 удалений

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

@ -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(

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

@ -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) => {

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

@ -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(

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

@ -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<QueryHistoryInfo[]> {
try {

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

@ -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(

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

@ -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([]);
});