Skip to content

Commit e63f0fc

Browse files
committed
Be able to specify the name of the skeleton query file
We introduced this QlPackGenerator a while ago. It always creates an `example.ql` query file as part of the skeleton pack. We'd like to set the name of the query file, since we'll allow the user to create queries multiple times in the same skeleton pack folder. The folder will be named `codeql-custom-queries-${language}` and will first receive an `example.ql` file. If the user then tries to create a new query for the same language, we'll just create an `example2.ql`, `example3.ql` etc. file in the existing folder.
1 parent 2995b01 commit e63f0fc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

extensions/ql-vscode/src/qlpack-generator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ export class QlPackGenerator {
6666
await writeFile(qlPackFilePath, this.header + dump(qlPackYml), "utf8");
6767
}
6868

69-
private async createExampleQlFile() {
70-
const exampleQlFilePath = join(this.folderUri.fsPath, "example.ql");
69+
public async createExampleQlFile(fileName = "example.ql") {
70+
const exampleQlFilePath = join(this.folderUri.fsPath, fileName);
7171

7272
const exampleQl = `
7373
/**

0 commit comments

Comments
 (0)