diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-06-13 15:48:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-13 15:48:53 -0400 |
commit | 015ea60d25a3c773fc9d9bf17fc904de236814f9 (patch) | |
tree | 7ad367b85a48fc5c0980bbfd91e98139d9f9da19 /cli/util/path.rs | |
parent | 92e7287f4a744cad1fbe46ba1ce84c2b479ce6ac (diff) |
fix(lsp): don't pre-load documents matched in the config file's "exclude" (#19431)
This prevents documents specified in a deno.json's "exclude" from being
pre-loaded by the lsp.
For example, someone may have something like:
```jsonc
// deno.json
{
"exclude": [
"dist" // build directory
]
}
```
Diffstat (limited to 'cli/util/path.rs')
-rw-r--r-- | cli/util/path.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/util/path.rs b/cli/util/path.rs index 39ba96d6d..ba1d0d926 100644 --- a/cli/util/path.rs +++ b/cli/util/path.rs @@ -73,7 +73,9 @@ pub fn mapped_specifier_for_tsc( pub fn specifier_to_file_path( specifier: &ModuleSpecifier, ) -> Result<PathBuf, AnyError> { - let result = if cfg!(windows) { + let result = if specifier.scheme() != "file" { + Err(()) + } else if cfg!(windows) { match specifier.to_file_path() { Ok(path) => Ok(path), Err(()) => { |