fix(lsp): silence tsc debug failures for inlay hints (#30456)
Some checks are pending
ci / build libs (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions

This commit is contained in:
Nayeem Rahman 2025-08-20 22:35:45 +01:00 committed by GitHub
parent c0bc233f1f
commit ab36a16bf3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4919,19 +4919,28 @@ impl Inner {
error!("Failed to convert range to text_span: {:#}", err);
LspError::internal_error()
})?;
let maybe_inlay_hints = self
let mut inlay_hints = self
.ts_server
.provide_inlay_hints(self.snapshot(), &module, text_span, token)
.await
.map_err(|err| {
if token.is_cancelled() {
LspError::request_cancelled()
} else {
error!("Unable to get inlay hints from TypeScript: {:#}", err);
LspError::internal_error()
}
})?;
let maybe_inlay_hints = maybe_inlay_hints
.await;
// Silence tsc debug failures.
// See https://github.com/denoland/deno/issues/30455.
// TODO(nayeemrmn): Keeps tabs on whether this is still necessary.
if let Err(err) = &inlay_hints
&& err.to_string().contains("Debug Failure")
{
lsp_warn!("Unable to get inlay hints from TypeScript: {:#}", err);
inlay_hints = Ok(None)
}
let inlay_hints = inlay_hints.map_err(|err| {
if token.is_cancelled() {
LspError::request_cancelled()
} else {
error!("Unable to get inlay hints from TypeScript: {:#}", err);
LspError::internal_error()
}
})?;
let inlay_hints = inlay_hints
.map(|hints| {
hints
.into_iter()
@ -4945,7 +4954,7 @@ impl Inner {
})
.transpose()?;
self.performance.measure(mark);
Ok(maybe_inlay_hints)
Ok(inlay_hints)
}
async fn reload_import_registries(&mut self) -> LspResult<Option<Value>> {