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:
parent
22426fee1e
commit
913d4f28b3
2 changed files with 7 additions and 3 deletions
|
@ -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!({
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue