-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Signature help suppresses arity error in editor #49624
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
Comments
I'm pretty sure we have an incremental parser bug. If I move atomically (with pasting) from fun('a', 3, 3, 'a', 3) to fun('a', 3, 3, 'a', 3, 3) then the error is always presented. If I insert the comma, then the argument, with delays, then it's a reliable repro that the error doesn't appear. More tellingingly, atomic edits from that point forward don't present an error unless I remove the line and put it back again |
Could be, but Iβm pretty sure signature help is also related somehow. I have automatic signature help turned off in my editor but frequently invoke it manually. By default, signature help appears when you type a comma, so that creates another difference vs. pasting. But in my editor, I canβt repro without invoking signature help. |
Fairly certain it's not related to incremental parsing. If you dismiss signature help and start typing, errors show up again. Manually triggering and typing makes it disappear. signatureHelpPoisoningTypeCheckerCache.webmHere's my theory from #52369:
|
This might be the same problem as the one that I'm trying to fix here. The problem recognized there is only relevant for one of the issues but we were discussing with @andrewbranch that the problem is likely to be much broader. I'm investigating the related issues to learn more about the scope so I can repurpose that PR to fix those kinds of issues holistically. |
After all, this feels a little bit different from the other case - the other case is strongly related to inference blocking and this doesn't look anything like that (so far). I've managed to create a test file for this: ///<reference path="fourslash.ts"/>
// @strict: true
////
//// declare function f(x: string, y: number): any;
////
//// /*1*/f(/*2*/)/*3*/
goTo.marker("2");
verify.signatureHelp({
triggerReason: {
kind: "invoked"
}
})
edit.insert(`"`)
edit.insert(`"`)
verify.signatureHelp({
triggerReason: {
kind: "retrigger"
}
})
verify.not.codeFixAvailable() // trigger typecheck
verify.errorExistsBetweenMarkers("1", "3"); If we remove the second |
I don't think this is related - the problem can already be observed in builds from before this PR has been merged: [email protected] playground. I identified a similar regression here to be caused by #36747 . We can also confirm that this issue here doesn't happen in a build from before this PR ([email protected] playground) and that is happens in a build after that has landed ([email protected] playground) |
Bug Report
π Search Terms
signature help missing errors
π Version & Regression Information
Saw this for the first time a few months ago, but could be older.
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
No error after following instructions, until making another edit elsewhere / with signature help closed
π Expected behavior
Arity error on the call
The text was updated successfully, but these errors were encountered: