Skip to content

Commit da92276

Browse files
authored
Merge pull request #23347 from github/rust/shared-library
Shared: Move parser-independent extractor code into extractor-common
2 parents ef93fa5 + 02576b9 commit da92276

37 files changed

Lines changed: 259 additions & 237 deletions

File tree

‎Cargo.lock‎

Lines changed: 8 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎misc/bazel/3rdparty/rust_workspace_deps/crates.bzl‎

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎ql/extractor/Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
2121
rayon = "1.9.0"
2222
regex = "1.10.4"
2323
codeql-extractor = { path = "../../shared/tree-sitter-extractor" }
24+
extractor-common = { path = "../../shared/extractor-common" }

‎ql/extractor/src/autobuilder.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::path::PathBuf;
33

44
use clap::Args;
55

6-
use codeql_extractor::autobuilder;
6+
use extractor_common::autobuilder;
77

88
#[derive(Args)]
99
// The autobuilder takes no command-line options, but this may change in the future.

‎ql/extractor/src/extractor.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use clap::Args;
22
use std::path::PathBuf;
33

44
use codeql_extractor::extractor::simple;
5-
use codeql_extractor::trap;
5+
use extractor_common::trap;
66

77
#[derive(Args)]
88
pub struct Options {
@@ -20,7 +20,7 @@ pub struct Options {
2020
}
2121

2222
pub fn run(options: Options) -> std::io::Result<()> {
23-
codeql_extractor::extractor::set_tracing_level("ql");
23+
extractor_common::extractor::set_tracing_level("ql");
2424

2525
let extractor = simple::Extractor {
2626
prefix: "ql".to_string(),

‎ql/extractor/src/generator.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub struct Options {
1515
}
1616

1717
pub fn run(options: Options) -> std::io::Result<()> {
18-
codeql_extractor::extractor::set_tracing_level("ql");
18+
extractor_common::extractor::set_tracing_level("ql");
1919

2020
let languages = vec![
2121
Language {

‎ruby/extractor/src/autobuilder.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::path::PathBuf;
33

44
use clap::Args;
55

6-
use codeql_extractor::autobuilder;
6+
use extractor_common::autobuilder;
77

88
#[derive(Args)]
99
// The autobuilder takes no command-line options, but this may change in the future.

‎ruby/extractor/src/extractor.rs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use clap::Args;
22
use extractor_common::file_paths::{self, PathTransformer};
3+
use extractor_common::trap;
34
use rayon::prelude::*;
45
use std::borrow::Cow;
56
use std::collections::HashSet;
@@ -9,7 +10,7 @@ use std::path::{Path, PathBuf};
910
use std::sync::LazyLock;
1011
use tree_sitter::{Language, Parser, Range};
1112

12-
use codeql_extractor::{diagnostics, extractor, node_types, trap};
13+
use codeql_extractor::{diagnostics, extractor, node_types};
1314

1415
#[derive(Args)]
1516
pub struct Options {
@@ -28,7 +29,7 @@ pub struct Options {
2829

2930
#[allow(clippy::too_many_lines)]
3031
pub fn run(options: &Options) -> std::io::Result<()> {
31-
extractor::set_tracing_level("ruby");
32+
extractor_common::extractor::set_tracing_level("ruby");
3233
tracing::info!("Extraction started");
3334
let diagnostics = diagnostics::DiagnosticLoggers::new("ruby");
3435
let mut main_thread_logger = diagnostics.logger();
@@ -229,7 +230,7 @@ pub fn run(options: &Options) -> std::io::Result<()> {
229230

230231
let path = PathBuf::from("extras");
231232
let mut trap_writer = trap::Writer::new();
232-
extractor::populate_empty_location(&mut trap_writer);
233+
extractor_common::extractor::populate_empty_location(&mut trap_writer);
233234
let res = write_trap(
234235
&trap_dir,
235236
&path,

‎ruby/extractor/src/generator.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub struct Options {
1515
}
1616

1717
pub fn run(options: Options) -> std::io::Result<()> {
18-
codeql_extractor::extractor::set_tracing_level("ruby");
18+
extractor_common::extractor::set_tracing_level("ruby");
1919

2020
let languages = vec![
2121
Language {

‎rust/autobuild/BUILD.bazel‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ codeql_rust_binary(
1414
deps = all_crate_deps(
1515
normal = True,
1616
) + [
17-
"//shared/tree-sitter-extractor",
17+
"//shared/extractor-common",
1818
],
1919
)

0 commit comments

Comments
 (0)