From 061090de7e95e8e7a97f3277bd1a72899ebd1570 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Wed, 30 Mar 2022 09:59:27 +1100 Subject: feat(lsp): add experimental testing API (#13798) Ref: denoland/vscode_deno#629 --- test_util/src/lsp.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'test_util/src') diff --git a/test_util/src/lsp.rs b/test_util/src/lsp.rs index 948dc4da6..9d5a74eaf 100644 --- a/test_util/src/lsp.rs +++ b/test_util/src/lsp.rs @@ -167,15 +167,18 @@ where } impl LspClient { - pub fn new(deno_exe: &Path) -> Result { + pub fn new(deno_exe: &Path, print_stderr: bool) -> Result { let deno_dir = new_deno_dir(); - let mut child = Command::new(deno_exe) + let mut command = Command::new(deno_exe); + command .env("DENO_DIR", deno_dir.path()) .arg("lsp") .stdin(Stdio::piped()) - .stdout(Stdio::piped()) - .stderr(Stdio::null()) - .spawn()?; + .stdout(Stdio::piped()); + if !print_stderr { + command.stderr(Stdio::null()); + } + let mut child = command.spawn()?; let stdout = child.stdout.take().unwrap(); let reader = io::BufReader::new(stdout); -- cgit v1.2.3