vscode_deno icon indicating copy to clipboard operation
vscode_deno copied to clipboard

Inlay Hints Broken

Open lishaduck opened this issue 1 year ago • 5 comments

Describe the bug

Periodically, I'll get a bunch (one per keystroke) of messages saying that "Request textDocument/inlayHint failed." I've also noticed my computer gets really slow, and I often get this in the terminal: zsh: fork failed: resource temporarily unavailable (which I think is about memory, for which the Code Helper (...) processes spike, a Code Helper (Plugin) hits 1gb of memory used, but I can't tell which one.). Not that that's _ necessarily_ related, but they all seem to trigger about the same time, and it's Deno for which it's noticeable.

To Reproduce

No idea, beyond that it triggers randomly on this project: https://github.com/lishaduck/effect-utils. I have yet to figure out what starts or stops it.

Expected behavior

It wouldn't do this.

Screenshots

Screenshot 2024-11-17 at 7 26 32 PM

Full logs: https://gist.github.com/lishaduck/3e8625fd0b227ed7723c012038223e04 Main errors:

Unable to get inlay hints: tsc error: Error: Debug Failure. False expression.
    at first (ext:deno_tsc/00_typescript.js:2917:9)
    at getArgumentArityError (ext:deno_tsc/00_typescript.js:79507:19)
    at resolveCall (ext:deno_tsc/00_typescript.js:79732:27)
    at resolveCallExpression (ext:deno_tsc/00_typescript.js:80050:12)
    at resolveSignature (ext:deno_tsc/00_typescript.js:80443:16)
    at getResolvedSignature (ext:deno_tsc/00_typescript.js:80469:18)
    at checkCallExpression (ext:deno_tsc/00_typescript.js:80580:23)
    at checkExpressionWorker (ext:deno_tsc/00_typescript.js:83986:16)
    at checkExpression (ext:deno_tsc/00_typescript.js:83886:32)
    at checkExpressionWithContextualType (ext:deno_tsc/00_typescript.js:83489:18)

(new one, didn't see this when I inspected it yesterday)

Error getting actions from TypeScript: tsc error: Error: Debug Failure. Invalid cast. The supplied value [object Object] did not pass the test 'isParameter'.
    at cast (ext:deno_tsc/00_typescript.js:3326:16)
    at doChange33 (ext:deno_tsc/00_typescript.js:161022:23)
    at ext:deno_tsc/00_typescript.js:160906:21
    at Function.with (ext:deno_tsc/00_typescript.js:175786:5)
    at Object.getCodeActions (ext:deno_tsc/00_typescript.js:160905:62)
    at ext:deno_tsc/00_typescript.js:152447:46
    at flatMap (ext:deno_tsc/00_typescript.js:2515:17)
    at Object.getFixes (ext:deno_tsc/00_typescript.js:152447:10)
    at ext:deno_tsc/00_typescript.js:150727:33
    at flatMap (ext:deno_tsc/00_typescript.js:2515:17)

Versions

deno 2.0.6 (release, aarch64-apple-darwin) | vscode_deno 3.42.0 | vscode 1.95.3

lishaduck avatar Nov 18 '24 01:11 lishaduck

Possibly related: #943

lishaduck avatar Nov 18 '24 01:11 lishaduck

This code triggers the same “False expression” error.

const id = <T>(x: T) => x;
id(
  id(
    "",
  ),
);

0f-0b avatar Dec 31 '24 20:12 0f-0b

I'm seeing a related issue but with a different stack deno 2.1.4 (stable, release, aarch64-apple-darwin) v8 13.0.245.12-rusty typescript 5.6.2

VSCode's typescript version is 5.7.2 and I wonder if that version mismatch has something to do with it.

[Error - 2:26:06 PM] Request textDocument/inlayHint failed.
  Message: Internal error
  Code: -32603 
Unable to get inlay hints: tsc error: Error: Debug Failure. Unexpected node.
Node ComputedPropertyName was unexpected.
    at visitForDisplayParts (ext:deno_tsc/00_typescript.js:172315:17)
    at visitForDisplayParts (ext:deno_tsc/00_typescript.js:172220:11)
    at ext:deno_tsc/00_typescript.js:172333:9
    at Array.forEach (<anonymous>)
    at visitDisplayPartList (ext:deno_tsc/00_typescript.js:172329:13)
    at visitForDisplayParts (ext:deno_tsc/00_typescript.js:172070:13)
    at getInlayHintDisplayParts (ext:deno_tsc/00_typescript.js:171963:5)
    at typeToInlayHintParts (ext:deno_tsc/00_typescript.js:171945:12)
    at visitFunctionDeclarationLikeForReturnType (ext:deno_tsc/00_typescript.js:171849:23)
    at visitor (ext:deno_tsc/00_typescript.js:171660:9)

rotu avatar Jan 01 '25 20:01 rotu

VSCode's typescript version is 5.7.2 and I wonder if that version mismatch has something to do with it

That's a good point! I've run into some other bugs with the ts mismatches, although the only suspicious change from the release notes is that they've enabled the V8 compile cache.

lishaduck avatar Jan 01 '25 20:01 lishaduck

I think it has to do something with the competing TypeScript servers, though not necessarily the version per se. There have been problems in the past with the project-wide TypeScript server, and now that VSCode is leaning more heavily on Copilot (including using copilot for autocomplete!), reliably turning off the integrated TypeScript server is becoming harder.

rotu avatar Jan 01 '25 22:01 rotu