summaryrefslogtreecommitdiff
path: root/test_util/src
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2022-03-30 09:59:27 +1100
committerGitHub <noreply@github.com>2022-03-30 09:59:27 +1100
commit061090de7e95e8e7a97f3277bd1a72899ebd1570 (patch)
tree85fbf3ed3dc4cf51a15c2baaf8257a47149c43ef /test_util/src
parent4a0b2c28a15d76c0c40bf07c3753dfbcce4dace1 (diff)
feat(lsp): add experimental testing API (#13798)
Ref: denoland/vscode_deno#629
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);