1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-27 01:29:14 -05:00

chore(tests): delete the temporary deno dir when dropping the test lsp client (#11749)

This commit is contained in:
David Sherret 2021-08-17 22:58:41 -04:00 committed by GitHub
parent 4b800f5d26
commit 480cfda8d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,6 +21,7 @@ use std::process::Command;
use std::process::Stdio;
use std::time::Duration;
use std::time::Instant;
use tempfile::TempDir;
lazy_static! {
static ref CONTENT_TYPE_REG: Regex =
@ -97,6 +98,7 @@ pub struct LspClient {
request_id: u64,
start: Instant,
writer: io::BufWriter<ChildStdin>,
_temp_deno_dir: TempDir, // directory will be deleted on drop
}
impl Drop for LspClient {
@ -179,6 +181,7 @@ impl LspClient {
request_id: 1,
start: Instant::now(),
writer,
_temp_deno_dir: deno_dir,
})
}