Rename to readQueryHistoryFromFile
This commit is contained in:
@@ -33,7 +33,7 @@ import { redactableError } from "../pure/errors";
|
||||
export class QueryInProgress {
|
||||
public queryEvalInfo: QueryEvaluationInfo;
|
||||
/**
|
||||
* Note that in the {@link readFromQueryHistoryFile} method, we create a QueryEvaluationInfo instance
|
||||
* Note that in the {@link readQueryHistoryFromFile} method, we create a QueryEvaluationInfo instance
|
||||
* by explicitly setting the prototype in order to avoid calling this constructor.
|
||||
*/
|
||||
constructor(
|
||||
|
||||
@@ -40,7 +40,7 @@ import {
|
||||
variantAnalysisStatusToQueryStatus,
|
||||
} from "../query-status";
|
||||
import {
|
||||
readFromQueryHistoryFile,
|
||||
readQueryHistoryFromFile,
|
||||
writeQueryHistoryToFile,
|
||||
} from "./store/query-history-store";
|
||||
import { pathExists } from "fs-extra";
|
||||
@@ -379,7 +379,7 @@ export class QueryHistoryManager extends DisposableObject {
|
||||
void extLogger.log(
|
||||
`Reading cached query history from '${this.queryMetadataStorageLocation}'.`,
|
||||
);
|
||||
const history = await readFromQueryHistoryFile(
|
||||
const history = await readQueryHistoryFromFile(
|
||||
this.queryMetadataStorageLocation,
|
||||
);
|
||||
this.treeDataProvider.allHistory = history;
|
||||
|
||||
@@ -14,7 +14,7 @@ import { QueryEvaluationInfo } from "../../run-queries-shared";
|
||||
import { QueryResultType } from "../../pure/legacy-messages";
|
||||
import { redactableError } from "../../pure/errors";
|
||||
|
||||
export async function readFromQueryHistoryFile(
|
||||
export async function readQueryHistoryFromFile(
|
||||
fsPath: string,
|
||||
): Promise<QueryHistoryInfo[]> {
|
||||
try {
|
||||
|
||||
@@ -70,7 +70,7 @@ export class CompletedQueryInfo implements QueryWithResults {
|
||||
interpretedResultsSortState: InterpretedResultsSortState | undefined;
|
||||
|
||||
/**
|
||||
* Note that in the {@link readFromQueryHistoryFile} method, we create a CompletedQueryInfo instance
|
||||
* Note that in the {@link readQueryHistoryFromFile} method, we create a CompletedQueryInfo instance
|
||||
* by explicitly setting the prototype in order to avoid calling this constructor.
|
||||
*/
|
||||
constructor(evaluation: QueryWithResults) {
|
||||
@@ -224,7 +224,7 @@ export class LocalQueryInfo {
|
||||
public evalLogSummarySymbolsLocation: string | undefined;
|
||||
|
||||
/**
|
||||
* Note that in the {@link readFromQueryHistoryFile} method, we create a FullQueryInfo instance
|
||||
* Note that in the {@link readQueryHistoryFromFile} method, we create a FullQueryInfo instance
|
||||
* by explicitly setting the prototype in order to avoid calling this constructor.
|
||||
*/
|
||||
constructor(
|
||||
|
||||
@@ -68,7 +68,7 @@ function findQueryEvalLogEndSummaryFile(resultPath: string): string {
|
||||
|
||||
export class QueryEvaluationInfo {
|
||||
/**
|
||||
* Note that in the {@link readFromQueryHistoryFile} method, we create a QueryEvaluationInfo instance
|
||||
* Note that in the {@link readQueryHistoryFromFile} method, we create a QueryEvaluationInfo instance
|
||||
* by explicitly setting the prototype in order to avoid calling this constructor.
|
||||
*/
|
||||
constructor(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {
|
||||
readFromQueryHistoryFile,
|
||||
readQueryHistoryFromFile,
|
||||
writeQueryHistoryToFile,
|
||||
} from "../../../../../src/query-history/store/query-history-store";
|
||||
import { join } from "path";
|
||||
@@ -98,7 +98,7 @@ describe("write and read", () => {
|
||||
|
||||
// write and read
|
||||
await writeQueryHistoryToFile(allHistory, allHistoryPath);
|
||||
const allHistoryActual = await readFromQueryHistoryFile(allHistoryPath);
|
||||
const allHistoryActual = await readQueryHistoryFromFile(allHistoryPath);
|
||||
|
||||
// the dispose methods will be different. Ignore them.
|
||||
allHistoryActual.forEach((info) => {
|
||||
@@ -181,7 +181,7 @@ describe("write and read", () => {
|
||||
"utf8",
|
||||
);
|
||||
|
||||
const actual = await readFromQueryHistoryFile(path);
|
||||
const actual = await readQueryHistoryFromFile(path);
|
||||
expect(actual.length).toEqual(expectedHistory.length);
|
||||
});
|
||||
|
||||
@@ -196,7 +196,7 @@ describe("write and read", () => {
|
||||
"utf8",
|
||||
);
|
||||
|
||||
const allHistoryActual = await readFromQueryHistoryFile(badPath);
|
||||
const allHistoryActual = await readQueryHistoryFromFile(badPath);
|
||||
// version number is invalid. Should return an empty array.
|
||||
expect(allHistoryActual).toEqual([]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user