summaryrefslogtreecommitdiff
path: root/cli/lsp/cache.rs
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2024-06-28 18:18:21 +0100
committerGitHub <noreply@github.com>2024-06-28 18:18:21 +0100
commit2ddae872f956ddd84656a302aa5f6b752f6a6ab5 (patch)
treeeebf667d2b9473b61f4c81021db7f73e8a2a83c4 /cli/lsp/cache.rs
parentec9963570bb3259952e3729517d665d70131c072 (diff)
fix(lsp): don't use global cache paths for scope allocation (#24353)
Diffstat (limited to 'cli/lsp/cache.rs')
-rw-r--r--cli/lsp/cache.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/cli/lsp/cache.rs b/cli/lsp/cache.rs
index e6186030a..5dae38c20 100644
--- a/cli/lsp/cache.rs
+++ b/cli/lsp/cache.rs
@@ -184,4 +184,13 @@ impl LspCache {
.as_ref()?;
vendor.get_remote_url(&path)
}
+
+ pub fn is_valid_file_referrer(&self, specifier: &ModuleSpecifier) -> bool {
+ if let Ok(path) = specifier_to_file_path(specifier) {
+ if !path.starts_with(&self.deno_dir().root) {
+ return true;
+ }
+ }
+ false
+ }
}