diff options
author | jeiea <solum5013@gmail.com> | 2021-06-06 14:00:17 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-06 15:00:17 +1000 |
commit | 633c5aab1f28538dde619fe755f8ec9fa77a3719 (patch) | |
tree | 78d215a995cbca7aabbb74d329f0f43156d721c2 /cli/lsp/language_server.rs | |
parent | 62bf4031576ab833a8057c6b7037e6476d13bf65 (diff) |
fix(#10747): cannot read config option in windows (#10791)
Fixes #10747
Diffstat (limited to 'cli/lsp/language_server.rs')
-rw-r--r-- | cli/lsp/language_server.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index 10bb0478e..9e4e6af14 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -447,7 +447,15 @@ impl Inner { )) }?; - let config_file = ConfigFile::read(config_url.path())?; + let config_file = { + let buffer = config_url + .to_file_path() + .map_err(|_| anyhow!("Bad uri: \"{}\"", config_url))?; + let path = buffer + .to_str() + .ok_or_else(|| anyhow!("Bad uri: \"{}\"", config_url))?; + ConfigFile::read(path)? + }; let (value, maybe_ignored_options) = config_file.as_compiler_options()?; tsconfig.merge(&value); self.maybe_config_uri = Some(config_url); |