1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-11 08:33:43 -05:00

fix(lsp): make failed to load config error descriptive (#10685)

This commit is contained in:
Satya Rohith 2021-05-19 02:18:11 +05:30 committed by Bert Belder
parent 22426fee1e
commit 913d4f28b3
No known key found for this signature in database
GPG key ID: 7A77887B2E2ED461
2 changed files with 7 additions and 3 deletions

View file

@ -339,6 +339,12 @@ mod tests {
assert!(config_file.json.compiler_options.is_some());
}
#[test]
fn include_config_path_on_error() {
let error = ConfigFile::read("404.json").err().unwrap();
assert!(error.to_string().contains("404.json"));
}
#[test]
fn test_json_merge() {
let mut value_a = json!({

View file

@ -2,7 +2,6 @@
use deno_core::error::anyhow;
use deno_core::error::AnyError;
use deno_core::error::Context;
use deno_core::resolve_url;
use deno_core::serde::Deserialize;
use deno_core::serde::Serialize;
@ -432,8 +431,7 @@ impl Inner {
))
}?;
let config_file = ConfigFile::read(config_url.path())
.context("Failed to load configuration file")?;
let config_file = ConfigFile::read(config_url.path())?;
let (value, maybe_ignored_options) = config_file.as_compiler_options()?;
tsconfig.merge(&value);
self.maybe_config_uri = Some(config_url);