Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inlay Hints Broken #1210

Open
lishaduck opened this issue Nov 18, 2024 · 5 comments
Open

Inlay Hints Broken #1210

lishaduck opened this issue Nov 18, 2024 · 5 comments

Comments

@lishaduck
Copy link

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
Copy link
Author

Possibly related: #943

@0f-0b
Copy link

0f-0b commented Dec 31, 2024

This code triggers the same “False expression” error.

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

@rotu
Copy link
Contributor

rotu commented Jan 1, 2025

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)

@lishaduck
Copy link
Author

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.

@rotu
Copy link
Contributor

rotu commented Jan 1, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants