summaryrefslogtreecommitdiff
path: root/cli/lsp/tsc.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-08-02 16:57:25 -0400
committerGitHub <noreply@github.com>2023-08-02 16:57:25 -0400
commit480894e5c8f9532a4c42477cdf5c058cb8e9e1e3 (patch)
tree7241c8864439b60c97f2140ccdef17ed07a5dbcf /cli/lsp/tsc.rs
parente8d03119a0599ef8d811f8fa33ad1a580adf5511 (diff)
feat(unstable/lsp): support navigating to deno_modules folder (#20030)
Closes #20015 Closes https://github.com/denoland/vscode_deno/issues/850 (only for deno_modules, but I don't think this will be possible for the global cache)
Diffstat (limited to 'cli/lsp/tsc.rs')
-rw-r--r--cli/lsp/tsc.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs
index b26fa57bc..353866513 100644
--- a/cli/lsp/tsc.rs
+++ b/cli/lsp/tsc.rs
@@ -3214,9 +3214,13 @@ fn op_script_names(state: &mut OpState) -> Vec<String> {
.filter_map(|dep| dep.get_type().or_else(|| dep.get_code())),
);
for specifier in specifiers {
- if seen.insert(specifier.as_str()) && documents.exists(specifier) {
- // only include dependencies we know to exist otherwise typescript will error
- result.push(specifier.to_string());
+ if seen.insert(specifier.as_str()) {
+ if let Some(specifier) = documents.resolve_redirected(specifier) {
+ // only include dependencies we know to exist otherwise typescript will error
+ if documents.exists(&specifier) {
+ result.push(specifier.to_string());
+ }
+ }
}
}
}