summaryrefslogtreecommitdiff
path: root/test_util/src
diff options
context:
space:
mode:
Diffstat (limited to 'test_util/src')
-rw-r--r--test_util/src/lsp.rs13
1 files changed, 8 insertions, 5 deletions
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<Self> {
+ pub fn new(deno_exe: &Path, print_stderr: bool) -> Result<Self> {
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);