-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
Implicitly typed parameters of function properties of generic parameters break autocompletion #46916
Comments
Note for future investigators: The magic concept at play here is the "context-sensitive" expression // enabled: (str) => str.length > 0 which is somehow defeating our logic that gets completions in the face of an incomplete generic call |
There are different angles to this issue. I'm not sure if it's worth fixing this but perhaps a fix to this would improve some other, more compelling, scenarios. First of all, this signature doesn't make much sense to me. The type parameter is defined as While investigating this case we can learn that, in a case without context-sensitive functions, completions are provided based on the signature computed by So why do context-sensitive functions break this? They make all objects that contain them (recursively, up to the root object) non-inferrable. So when That is later used to obtain the So what could potentially be done about this?
|
I'm thinking about this more and more and I have a hunch that there might be something in that third idea. I imagine that each cc @andrewbranch maybe you'd be interested in this... am I completely delusional here or does this sound plausible? 😅 |
Bug Report
🔎 Search Terms
generic parameter autocomplete
extends autocomplete
parameter breaks autocomplete
implicit parameter breaks autocomplete
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
No autocomplete inside
defineSteps({ ... })
after defining a function with an implicitly typed parameter in any ofenabled
properties. TS can't even get the parameter type implicitly on v3.3.3, so my guess is some stuff got improved which helped to infer the type, but there is something slightly wrong under the carpet, which causes this.🙂 Expected behavior
Getting autocomplete inside
defineSteps({ ... })
, even when I define a function with an implicitly typed parameter.The text was updated successfully, but these errors were encountered: