mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
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
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:
parent
c0bc233f1f
commit
ab36a16bf3
1 changed files with 21 additions and 12 deletions
|
@ -4919,11 +4919,20 @@ impl Inner {
|
||||||
error!("Failed to convert range to text_span: {:#}", err);
|
error!("Failed to convert range to text_span: {:#}", err);
|
||||||
LspError::internal_error()
|
LspError::internal_error()
|
||||||
})?;
|
})?;
|
||||||
let maybe_inlay_hints = self
|
let mut inlay_hints = self
|
||||||
.ts_server
|
.ts_server
|
||||||
.provide_inlay_hints(self.snapshot(), &module, text_span, token)
|
.provide_inlay_hints(self.snapshot(), &module, text_span, token)
|
||||||
.await
|
.await;
|
||||||
.map_err(|err| {
|
// 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() {
|
if token.is_cancelled() {
|
||||||
LspError::request_cancelled()
|
LspError::request_cancelled()
|
||||||
} else {
|
} else {
|
||||||
|
@ -4931,7 +4940,7 @@ impl Inner {
|
||||||
LspError::internal_error()
|
LspError::internal_error()
|
||||||
}
|
}
|
||||||
})?;
|
})?;
|
||||||
let maybe_inlay_hints = maybe_inlay_hints
|
let inlay_hints = inlay_hints
|
||||||
.map(|hints| {
|
.map(|hints| {
|
||||||
hints
|
hints
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -4945,7 +4954,7 @@ impl Inner {
|
||||||
})
|
})
|
||||||
.transpose()?;
|
.transpose()?;
|
||||||
self.performance.measure(mark);
|
self.performance.measure(mark);
|
||||||
Ok(maybe_inlay_hints)
|
Ok(inlay_hints)
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn reload_import_registries(&mut self) -> LspResult<Option<Value>> {
|
async fn reload_import_registries(&mut self) -> LspResult<Option<Value>> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue