summaryrefslogtreecommitdiff
path: root/src/snapshot.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/snapshot.rs')
-rw-r--r--src/snapshot.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/snapshot.rs b/src/snapshot.rs
index 16a186c29..ac1648e0c 100644
--- a/src/snapshot.rs
+++ b/src/snapshot.rs
@@ -12,3 +12,15 @@ pub fn deno_snapshot() -> deno_buf {
unsafe { deno_buf::from_raw_parts(data.as_ptr(), data.len()) }
}
+
+pub fn compiler_snapshot() -> deno_buf {
+ #[cfg(not(feature = "check-only"))]
+ let data =
+ include_bytes!(concat!(env!("GN_OUT_DIR"), "/gen/snapshot_compiler.bin"));
+ // The snapshot blob is not available when the Rust Language Server runs
+ // 'cargo check'.
+ #[cfg(feature = "check-only")]
+ let data = vec![];
+
+ unsafe { deno_buf::from_raw_parts(data.as_ptr(), data.len()) }
+}