summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Whitaker <17734409+nathanwhit@users.noreply.github.com>2024-04-11 11:33:03 -0700
committerGitHub <noreply@github.com>2024-04-11 18:33:03 +0000
commit4ab0215727be2f2c97e1c7d05b86aa1b93007e3b (patch)
tree7c1583323cb3a1aecb687a0e71d206d44d8cd6c0
parentdf73db671beada623a937bf4aad28a486d397971 (diff)
fix(lsp): Denormalize specifiers before calling `$projectChanged` (#23322)
Fixes the regression described in https://github.com/denoland/deno/pull/23293#issuecomment-2049819724. This affected jupyter notebooks, as the LSP was passing in already denormalized specifiers, while the jupyter kernel was not. We need to denormalize the specifiers to evict the proper keys from our caches.
-rw-r--r--cli/lsp/tsc.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs
index 53a35c484..d62744e03 100644
--- a/cli/lsp/tsc.rs
+++ b/cli/lsp/tsc.rs
@@ -303,6 +303,10 @@ impl TsServer {
new_project_version: String,
config_changed: bool,
) {
+ let modified_scripts = modified_scripts
+ .iter()
+ .map(|(spec, change)| (self.specifier_map.denormalize(spec), change))
+ .collect::<Vec<_>>();
let req = TscRequest {
method: "$projectChanged",
args: json!([modified_scripts, new_project_version, config_changed,]),