summaryrefslogtreecommitdiff
path: root/cli/lsp/documents.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2021-11-23 10:38:11 -0500
committerGitHub <noreply@github.com>2021-11-23 10:38:11 -0500
commit51e3db956a5927229e3f46f4eaaf317e935f8f17 (patch)
tree1af79152c7c1edc2c9bc21e8501aad1ba5d7e426 /cli/lsp/documents.rs
parentd8afd5683857de83f3cc80c33322df3d65377210 (diff)
fix(cli): config file should resolve paths relative to the config file (#12867)
* Add `specifier_to_file_path` to support converting a ModuleSpecifier with a unix-style path to a PathBuf on Windows.
Diffstat (limited to 'cli/lsp/documents.rs')
-rw-r--r--cli/lsp/documents.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs
index a46fdb8ce..d5acac8d7 100644
--- a/cli/lsp/documents.rs
+++ b/cli/lsp/documents.rs
@@ -8,6 +8,7 @@ use crate::config_file::ConfigFile;
use crate::file_fetcher::get_source_from_bytes;
use crate::file_fetcher::map_content_type;
use crate::file_fetcher::SUPPORTED_SCHEMES;
+use crate::fs_util::specifier_to_file_path;
use crate::http_cache;
use crate::http_cache::HttpCache;
use crate::resolver::ImportMapResolver;
@@ -741,7 +742,7 @@ fn get_document_path(
specifier: &ModuleSpecifier,
) -> Option<PathBuf> {
if specifier.scheme() == "file" {
- specifier.to_file_path().ok()
+ specifier_to_file_path(specifier).ok()
} else {
let path = cache.get_cache_filename(specifier)?;
if path.is_file() {