Skip to content

Commit a34ded9

Browse files
committed
Update query history store code comments
1 parent be65a56 commit a34ded9

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

extensions/ql-vscode/src/query-history/store/query-history-domain-mapper.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ import {
2222
SortedResultSetInfo,
2323
} from "../../pure/interface-types";
2424

25-
// Maps Query History Domain Models to Data Models
26-
2725
export function mapQueryHistoryToDto(
2826
queries: QueryHistoryInfo[],
2927
): QueryHistoryItemDto[] {

extensions/ql-vscode/src/query-history/store/query-history-dto-mapper.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ import {
2424
SortedResultSetInfo,
2525
} from "../../pure/interface-types";
2626

27-
// Maps Query History Data Models to Domain Models
28-
2927
export function mapQueryHistoryToDomainModel(
3028
queries: QueryHistoryItemDto[],
3129
): QueryHistoryInfo[] {

extensions/ql-vscode/src/query-history/store/query-history-local-query-dto.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Contains models and consts for the data we want to store in the query history store.
2+
// Changes to these models should be done carefully and account for backwards compatibility of data.
3+
14
export interface QueryHistoryLocalQueryDto {
25
initialInfo: InitialQueryInfoDto;
36
t: "local";

extensions/ql-vscode/src/query-history/store/query-history-store.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ export async function readQueryHistoryFromFile(
4545
const domainModels: QueryHistoryInfo[] =
4646
mapQueryHistoryToDomainModel(parsedQueries);
4747

48-
// filter out queries that have been deleted on disk
48+
// Filter out queries that have been deleted on disk
4949
// most likely another workspace has deleted them because the
5050
// queries aged out.
5151
const filteredDomainModels: Promise<QueryHistoryInfo[]> = asyncFilter(
5252
domainModels,
5353
async (q) => {
5454
if (q.t === "variant-analysis") {
55-
// the query history store doesn't know where variant analysises are
55+
// The query history store doesn't know where variant analysises are
5656
// stored so we need to assume here that they exist. We check later
5757
// to see if they exist on disk.
5858
return true;
@@ -70,7 +70,7 @@ export async function readQueryHistoryFromFile(
7070
fullMessage: `Error loading query history.\n${getErrorStack(e)}`,
7171
},
7272
);
73-
// since the query history is invalid, it should be deleted so this error does not happen on next startup.
73+
// Since the query history is invalid, it should be deleted so this error does not happen on next startup.
7474
await remove(fsPath);
7575
return [];
7676
}
@@ -93,12 +93,12 @@ export async function writeQueryHistoryToFile(
9393
if (!(await pathExists(fsPath))) {
9494
await mkdir(dirname(fsPath), { recursive: true });
9595
}
96-
// remove incomplete local queries since they cannot be recreated on restart
96+
// Remove incomplete local queries since they cannot be recreated on restart
9797
const filteredQueries = queries.filter((q) =>
9898
q.t === "local" ? q.completedQuery !== undefined : true,
9999
);
100100

101-
// map domain model queries to data model
101+
// Map domain model queries to data model
102102
const queryHistoryData = mapQueryHistoryToDto(filteredQueries);
103103

104104
const data = JSON.stringify(

extensions/ql-vscode/src/query-history/store/query-history-variant-analysis-dto.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Contains models and consts for the data we want to store in the query history store.
2+
// Changes to these models should be done carefully and account for backwards compatibility of data.
3+
14
import { QueryLanguage } from "../../common/query-language";
25
import { QueryStatus } from "../../query-status";
36
import {
@@ -6,7 +9,6 @@ import {
69
VariantAnalysisStatus,
710
} from "../../variant-analysis/shared/variant-analysis";
811

9-
// Data Model for Variant Analysis Query History Items
1012
// All data points are modelled, except enums.
1113

1214
export interface QueryHistoryVariantAnalysisDto {

0 commit comments

Comments
 (0)