Skip to content

Commit f0d0325

Browse files
committed
tree-sitter: Add dbscheme regeneration instructions
1 parent 0d84f20 commit f0d0325

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

ql/extractor/src/generator.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@ pub fn run(options: Options) -> std::io::Result<()> {
3636
},
3737
];
3838

39-
generate(languages, options.dbscheme, options.library)
39+
generate(languages, options.dbscheme, options.library,
40+
"run 'scripts/create-extractor-pack.sh' in ql/")
4041
}

ruby/extractor/src/generator.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,10 @@ pub fn run(options: Options) -> std::io::Result<()> {
2828
},
2929
];
3030

31-
generate(languages, options.dbscheme, options.library)
31+
generate(
32+
languages,
33+
options.dbscheme,
34+
options.library,
35+
"run 'make dbscheme' in ql/ruby/",
36+
)
3237
}

shared/tree-sitter-extractor/src/generator/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ pub fn generate(
1717
languages: Vec<language::Language>,
1818
dbscheme_path: PathBuf,
1919
ql_library_path: PathBuf,
20+
regenerate_instructions: &str,
2021
) -> std::io::Result<()> {
2122
let dbscheme_file = File::create(dbscheme_path).map_err(|e| {
2223
tracing::error!("Failed to create dbscheme file: {}", e);
@@ -26,8 +27,9 @@ pub fn generate(
2627
writeln!(
2728
dbscheme_writer,
2829
"// CodeQL database schema for {}\n\
29-
// Automatically generated from the tree-sitter grammar; do not edit\n",
30-
languages[0].name
30+
// Automatically generated from the tree-sitter grammar; do not edit\n\
31+
// To regenerate, {}\n",
32+
languages[0].name, regenerate_instructions
3133
)?;
3234

3335
writeln!(dbscheme_writer, include_str!("prefix.dbscheme"))?;

0 commit comments

Comments
 (0)