deno/cli
Nathan Whitaker 66b66de96a
fix(lsp): Catch cancellation exceptions thrown by TSC, stop waiting for TS result upon cancellation (#23645)
Fixes #23643.

We weren't catching the cancellation exception thrown by TSC on the JS
side, so the rust side was catching this exception and then attempting
to print out the exception via `toString`. That last bit resulted in a
cryptic `[object Object]` showing up in the logs like so:

```
Error during TS request "getCompletionEntryDetails":
  [object Object]
```

I'm not 100% sure how we weren't seeing this in the past. My guess is
that #23409 and the subsequent PR to improve the exception catching and
logging surfaced this, but I'm still not quite clear on it.

My initial fix here returned `null` to rust when a server request was
cancelled, but this resulted in a deserialization error when we
attempted to deserialize that into the expected response type. So now,
as soon as the request's cancellation token signals we'll stop waiting
for a response and return an error (which will get swallowed as the LSP
request is being cancelled).

I was a bit surprised to find that [this
branch](0c671c9792/cli/lsp/tsc.rs (L1093))
actually executes sometimes, I believe due to the fact that aborting a
future may not [immediately stop its
execution](https://docs.rs/futures/latest/futures/stream/struct.AbortHandle.html#method.abort).
2024-05-01 20:31:11 -07:00
..
args feat(cli): add support for jsxImportSourceTypes (#23419) 2024-04-30 18:12:35 +00:00
bench chore(lsp): Include new benchmark in the collected benchmark data (#23420) 2024-04-17 20:55:56 +01:00
cache chore: add tests for moduleGraph2 (#23603) 2024-04-29 14:09:58 -04:00
js chore: update references to deno_std to use JSR (#23239) 2024-04-10 17:26:35 -04:00
lsp fix(lsp): Catch cancellation exceptions thrown by TSC, stop waiting for TS result upon cancellation (#23645) 2024-05-01 20:31:11 -07:00
napi 1.43.0 (#23629) 2024-05-01 12:16:39 +05:30
npm fix(npm): do not panic hitting root dir while resolving npm package (#23556) 2024-04-25 14:13:55 +00:00
ops refactor(jupyter): move communication methods out of data structs (#23622) 2024-05-01 02:30:40 +00:00
schemas feat(cli): add support for jsxImportSourceTypes (#23419) 2024-04-30 18:12:35 +00:00
standalone fix(compile): certain jsr specifiers sometimes can't load (#23567) 2024-04-27 21:11:57 +00:00
tools refactor(jupyter): move communication methods out of data structs (#23622) 2024-05-01 02:30:40 +00:00
tsc fix(lsp): Catch cancellation exceptions thrown by TSC, stop waiting for TS result upon cancellation (#23645) 2024-05-01 20:31:11 -07:00
util feat(runtime): Allow embedders to perform additional access checks on file open (#23208) 2024-04-19 18:12:03 -06:00
auth_tokens.rs fix(cli): Add IP address support to DENO_AUTH_TOKEN (#22297) 2024-02-06 19:45:40 +01:00
build.rs feat(runtime): allow adding custom extensions to snapshot (#23569) 2024-05-01 22:00:32 +00:00
Cargo.toml 1.43.0 (#23629) 2024-05-01 12:16:39 +05:30
cdp.rs refactor(tools/repl): reorganize code (#21810) 2024-01-05 16:14:58 +01:00
deno.ico fix(cli): add icon and metadata to deno.exe on Windows (#6693) 2020-07-15 21:54:38 +02:00
emit.rs fix(publish): support import equals (#23421) 2024-04-17 19:15:02 +00:00
entitlements.plist chore: start codesigning mac release builds (#21303) 2023-11-23 15:30:26 -07:00
errors.rs fix: upgrade to deno_ast 0.33 (#22341) 2024-02-09 01:40:26 +00:00
factory.rs feat: Add deno serve subcommand (#23511) 2024-04-24 19:45:49 +00:00
file_fetcher.rs refactor: move redirect handling into deno_graph (#23444) 2024-04-19 01:43:28 +00:00
graph_util.rs feat(jsr): support importing from jsr via HTTPS specifiers (except for type checking) (#23513) 2024-04-24 21:43:34 +00:00
http_util.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
integration_tests_runner.rs chore: continue tests/ re-org (#22396) 2024-02-12 17:13:14 -07:00
js.rs chore(cli): remove problematic snapshot test (#22722) 2024-03-05 19:11:33 -07:00
jsr.rs feat(jsr): support importing from jsr via HTTPS specifiers (except for type checking) (#23513) 2024-04-24 21:43:34 +00:00
main.rs FUTURE: remove import assertions support for JavaScript (#23541) 2024-04-29 22:43:05 +02:00
mainrt.rs refactor: cleanup main entrypoint (#23145) 2024-03-31 10:58:19 -04:00
module_loader.rs perf: v8 code cache (#23081) 2024-04-17 07:19:55 -07:00
node.rs feat(runtime): Allow embedders to perform additional access checks on file open (#23208) 2024-04-19 18:12:03 -06:00
README.md docs(cli): do not need gen doc for cli (#17260) 2023-01-04 13:19:58 +01:00
resolver.rs feat(cli): add support for jsxImportSourceTypes (#23419) 2024-04-30 18:12:35 +00:00
version.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
worker.rs feat: Add deno serve subcommand (#23511) 2024-04-24 19:45:49 +00:00

Deno CLI Crate

crates

This provides the actual deno executable and the user-facing APIs.

The deno crate uses the deno_core to provide the executable.