summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2018-12-19 04:09:34 +0100
committerBert Belder <bertbelder@gmail.com>2018-12-19 04:10:10 +0100
commit22874d44a65ed670735fb0d7f6bc8de45f13620a (patch)
tree6b935d42fdef0ca6ad370be446142ff4260eb81f /src
parentaa66ef98ea6144abd2d2714fef1dfc8046e01775 (diff)
build: fix RLS-invoked 'cargo check' build
Diffstat (limited to 'src')
-rw-r--r--src/js_errors.rs3
-rw-r--r--src/snapshot.rs5
2 files changed, 8 insertions, 0 deletions
diff --git a/src/js_errors.rs b/src/js_errors.rs
index d03564828..7b4e14321 100644
--- a/src/js_errors.rs
+++ b/src/js_errors.rs
@@ -277,6 +277,9 @@ fn parse_map_string(
getter: &SourceMapGetter,
) -> Option<SourceMap> {
match script_name {
+ // The bundle does not get built for 'cargo check', so we don't embed the
+ // bundle source map.
+ #[cfg(not(feature = "check-only"))]
"gen/bundle/main.js" => {
let s =
include_str!(concat!(env!("GN_OUT_DIR"), "/gen/bundle/main.js.map"));
diff --git a/src/snapshot.rs b/src/snapshot.rs
index fa7837ede..264395093 100644
--- a/src/snapshot.rs
+++ b/src/snapshot.rs
@@ -2,8 +2,13 @@
use libdeno::deno_buf;
pub fn deno_snapshot() -> deno_buf {
+ #[cfg(not(feature = "check-only"))]
let data =
include_bytes!(concat!(env!("GN_OUT_DIR"), "/gen/snapshot_deno.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()) }
}