deno
8b46ff4f - chore(lsp): regression test for inlay hints on computed property names (#34518)

Commit
152 days ago
chore(lsp): regression test for inlay hints on computed property names (#34518) ## Summary Adds an LSP regression test for [denoland/deno#30455](https://github.com/denoland/deno/issues/30455). The TypeScript inlay hint walker used to throw ``` Debug Failure. Unexpected node. Node ComputedPropertyName was unexpected. ``` when asked to display a return type whose object literal contained a computed key such as `[Symbol.dispose]`. The class from the original report — ```ts class Mutex { #queue: (() => void)[] = []; async acquire() { const pwr = Promise.withResolvers<void>(); this.#queue.push(pwr.resolve.bind(pwr)); if (this.#queue.length === 1) { this.#queue[0](); } await pwr.promise; return { [Symbol.dispose]: () => { this.#queue.shift(); if (this.#queue.length > 0) { this.#queue[0](); } }, }; } } ``` — now resolves inlay hints without errors because the bundled TypeScript already carries the upstream fix from [microsoft/TypeScript#61857](https://github.com/microsoft/TypeScript/pull/61857) (`visitForDisplayParts` now visits `ComputedPropertyName`), which arrived in Deno via the 5.9.2 update (#30601) and is retained in the 6.0.3 update (#32944). This PR adds a regression test using the original repro file so the LSP suite locks the fix in. The expectation is intentionally loose — any inlay hint on the `acquire()` signature line is enough, since the original bug short-circuited the whole request with an internal error. ## Test plan - [ ] CI runs the new `lsp_inlay_hints_computed_property_name` test. - [x] `cargo check -p integration_tests --tests` passes locally. Closes denoland/orchid#255 --------- Co-authored-by: divybot <divybot@users.noreply.github.com> Co-authored-by: Divy Srivastava <me@littledivy.com>
Author
Parents
Loading