mirror of
https://github.com/denoland/deno.git
synced 2025-01-21 21:50:00 -05:00
fix(lsp): make failed to load config error descriptive (#10685)
This commit is contained in:
parent
cda09c166f
commit
19e4080fa2
2 changed files with 7 additions and 3 deletions
|
@ -339,6 +339,12 @@ mod tests {
|
||||||
assert!(config_file.json.compiler_options.is_some());
|
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]
|
#[test]
|
||||||
fn test_json_merge() {
|
fn test_json_merge() {
|
||||||
let mut value_a = json!({
|
let mut value_a = json!({
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
use deno_core::error::anyhow;
|
use deno_core::error::anyhow;
|
||||||
use deno_core::error::AnyError;
|
use deno_core::error::AnyError;
|
||||||
use deno_core::error::Context;
|
|
||||||
use deno_core::resolve_url;
|
use deno_core::resolve_url;
|
||||||
use deno_core::serde::Deserialize;
|
use deno_core::serde::Deserialize;
|
||||||
use deno_core::serde::Serialize;
|
use deno_core::serde::Serialize;
|
||||||
|
@ -432,8 +431,7 @@ impl Inner {
|
||||||
))
|
))
|
||||||
}?;
|
}?;
|
||||||
|
|
||||||
let config_file = ConfigFile::read(config_url.path())
|
let config_file = ConfigFile::read(config_url.path())?;
|
||||||
.context("Failed to load configuration file")?;
|
|
||||||
let (value, maybe_ignored_options) = config_file.as_compiler_options()?;
|
let (value, maybe_ignored_options) = config_file.as_compiler_options()?;
|
||||||
tsconfig.merge(&value);
|
tsconfig.merge(&value);
|
||||||
self.maybe_config_uri = Some(config_url);
|
self.maybe_config_uri = Some(config_url);
|
||||||
|
|
Loading…
Add table
Reference in a new issue