tree-sitter: Add dbscheme regeneration instructions

This commit is contained in:
Ian Lynagh
2026-01-13 17:17:23 +00:00
parent 470bc7d6da
commit c6500e2759
3 changed files with 12 additions and 4 deletions

View File

@@ -36,5 +36,6 @@ pub fn run(options: Options) -> std::io::Result<()> {
},
];
generate(languages, options.dbscheme, options.library)
generate(languages, options.dbscheme, options.library,
"run 'scripts/create-extractor-pack.sh' in ql/")
}

View File

@@ -28,5 +28,10 @@ pub fn run(options: Options) -> std::io::Result<()> {
},
];
generate(languages, options.dbscheme, options.library)
generate(
languages,
options.dbscheme,
options.library,
"run 'make dbscheme' in ql/ruby/",
)
}

View File

@@ -17,6 +17,7 @@ pub fn generate(
languages: Vec<language::Language>,
dbscheme_path: PathBuf,
ql_library_path: PathBuf,
regenerate_instructions: &str,
) -> std::io::Result<()> {
let dbscheme_file = File::create(dbscheme_path).map_err(|e| {
tracing::error!("Failed to create dbscheme file: {}", e);
@@ -26,8 +27,9 @@ pub fn generate(
writeln!(
dbscheme_writer,
"// CodeQL database schema for {}\n\
// Automatically generated from the tree-sitter grammar; do not edit\n",
languages[0].name
// Automatically generated from the tree-sitter grammar; do not edit\n\
// To regenerate, {}\n",
languages[0].name, regenerate_instructions
)?;
writeln!(dbscheme_writer, include_str!("prefix.dbscheme"))?;