Skip to content

Commit 9c8f614

Browse files
authored
Merge pull request github#17408 from github/aibaars/rust-experiment
Rust: add partial extractor for Expr, Statement, Pattern
2 parents 26b9de3 + bffdf2b commit 9c8f614

File tree

232 files changed

+5672
-3525
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+5672
-3525
lines changed

rust/codeql-extractor.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,24 @@ file_types:
1313
- name: rust
1414
display_name: Rust files
1515
extensions:
16-
- .rs
16+
- .rs
17+
options:
18+
trap:
19+
title: Options pertaining to TRAP.
20+
type: object
21+
properties:
22+
compression:
23+
title: Controls compression for the TRAP files written by the extractor.
24+
description: >
25+
This option is only intended for use in debugging the extractor. Accepted
26+
values are 'brotli' (the default, to write brotli-compressed TRAP), 'gzip', and 'none'
27+
(to write uncompressed TRAP).
28+
type: string
29+
pattern: "^(none|gzip|brotli)$"
30+
extract_dependencies:
31+
title: Whether to extract dependencies.
32+
description: >
33+
Extract the source code of dependencies and the standard libraries in addition to
34+
normal source code.
35+
type: string
36+
pattern: "^(false|true)$"

rust/extractor/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/extractor/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ ra_ap_hir = "0.0.232"
1616
ra_ap_hir_def = "0.0.232"
1717
ra_ap_ide_db = "0.0.232"
1818
ra_ap_load-cargo = "0.0.232"
19+
ra_ap_paths = "0.0.232"
1920
ra_ap_project_model = "0.0.232"
2021
ra_ap_syntax = "0.0.232"
2122
ra_ap_vfs = "0.0.232"

rust/extractor/src/config.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ pub struct Config {
3232
pub scratch_dir: PathBuf,
3333
pub trap_dir: PathBuf,
3434
pub source_archive_dir: PathBuf,
35+
pub extract_dependencies: bool,
3536
pub verbose: u8,
3637
pub compression: Compression,
3738
pub inputs: Vec<PathBuf>,
@@ -68,10 +69,11 @@ impl Config {
6869
let inputs_list = std::fs::read_to_string(inputs_file).context("reading file list")?;
6970
cli_args
7071
.inputs
71-
.extend(inputs_list.split("\n").map(PathBuf::from));
72+
.extend(inputs_list.split_terminator("\n").map(PathBuf::from));
7273
}
7374
Figment::new()
7475
.merge(Env::prefixed("CODEQL_EXTRACTOR_RUST_"))
76+
.merge(Env::prefixed("CODEQL_EXTRACTOR_RUST_OPTION_"))
7577
.merge(Serialized::defaults(cli_args))
7678
.extract()
7779
.context("loading configuration")

rust/extractor/src/generated/.generated.list

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)