Skip to content

Commit d84baed

Browse files
author
Dave Bartolomeo
committed
Use default value for id parameter of createQueryRun()
1 parent a8cd9c2 commit d84baed

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

extensions/ql-vscode/src/queryRunner.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,24 +110,23 @@ export abstract class QueryRunner {
110110
generateEvalLog: boolean,
111111
additionalPacks: string[],
112112
queryStorageDir: string,
113-
id: string | undefined,
113+
id = `${basename(query.queryPath)}-${nanoid()}`,
114114
templates: Record<string, string> | undefined,
115115
): CoreQueryRun {
116-
const actualId = id ?? `${basename(query.queryPath)}-${nanoid()}`;
117-
const outputDir = new QueryOutputDir(join(queryStorageDir, actualId));
116+
const outputDir = new QueryOutputDir(join(queryStorageDir, id));
118117

119118
return {
120119
queryTarget: query,
121120
dbPath,
122-
id: actualId,
121+
id,
123122
outputDir,
124123
evaluate: async (
125124
progress: ProgressCallback,
126125
token: CancellationToken,
127126
logger: BaseLogger,
128127
): Promise<CoreCompletedQuery> => {
129128
return {
130-
id: actualId,
129+
id,
131130
outputDir,
132131
dbPath,
133132
queryTarget: query,

0 commit comments

Comments
 (0)