Skip to content

Commit

Permalink
more RA tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Jan 6, 2024
1 parent 129a81d commit eed819a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ https://github.com/langston-barrett/tree-splicer code mutator which icemaker can

Trophy case (840+):

https://github.com/rust-lang/rust-analyzer/issues/16288
https://github.com/rust-lang/rust-analyzer/issues/16287
https://github.com/rust-lang/rust-analyzer/issues/16286
https://github.com/rust-lang/rust-analyzer/issues/16284
https://github.com/rust-lang/rust-analyzer/issues/16283
https://github.com/rust-lang/rust-analyzer/issues/16282
https://github.com/rust-lang/rust-analyzer/issues/16281
Expand Down
16 changes: 11 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2921,7 +2921,8 @@ pub(crate) fn reduce_ice_code_to_string(ice: ICE, global_tempdir_path: &Path) ->
let tempdir = TempDir::new_in(global_tempdir_path, "icemaker_reducing_tempdir").unwrap();
let tempdir_path = tempdir.path();

if matches!(executable, Executable::Rustc) && matches!(kind, ICEKind::Ice(_))
if matches!(executable, Executable::Rustc | Executable::RustAnalyzer)
&& matches!(kind, ICEKind::Ice(_))
|| matches!(kind, ICEKind::DoubleIce)
&&
// skip OOMs which treereduce cant really handle
Expand Down Expand Up @@ -2964,12 +2965,17 @@ pub(crate) fn reduce_ice_code_to_string(ice: ICE, global_tempdir_path: &Path) ->
"--cpu=60",
]);
trd.arg(&bin);

if !flags.is_empty() {
trd.args(flags);
if executable == &Executable::RustAnalyzer {
// THIS NEEDS TO BE IN SYNC WITH run_rust_analyzer() arg!!
trd.arg("highlight");
} else {
if !flags.is_empty() {
trd.args(flags);
}
trd.arg("@@.rs");
}
trd.arg("@@.rs");
trd.current_dir(tempdir_path);

let output = trd.output().unwrap();
let reduced_file = String::from_utf8_lossy(&output.stdout).to_string();
let reduced_file_clone = reduced_file.clone();
Expand Down
1 change: 1 addition & 0 deletions src/run_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,7 @@ pub(crate) fn run_rust_analyzer(
let mut cmd = Command::new("prlimit")
.args(["--noheadings", "--as=3076000000", "--cpu=30"])
.arg(executable)
// THIS cmd NEEDS TO BE IN SYNC WITH fn reduce_ice_code_to_string() !!
.arg("highlight")
.stdin(Stdio::piped())
.stdout(Stdio::piped())
Expand Down

0 comments on commit eed819a

Please sign in to comment.