-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Debug Failure. False expression: JsxText
tokens should not be the first child of JsxElement | JsxSelfClosingElement
in findRightmostChildNodeWithTokens
during getQuickInfoAtPosition
#20788
Comments
The |
The assertion was added in #16385. Since then we've added JSX fragment syntax (#19249), so that might have to do with the error. The first child of some node is a @uniqueiniquity Do you think this might have been fixed by #20912? If it helps, I wrote this helper method in public verifyPreceding() {
for (const fileName of this.getProgram().getRootFileNames()) {
const file = this.getProgram().getSourceFile(fileName);
for (let i = 0; i < file.text.length; i++) {
ts.findPrecedingToken(i, file);
}
};
} You also need to add in |
@andy-ms I doubt #20912 would have fixed this since it was just related to behavior on format. |
I am looking into this further. |
@andy-ms your helper function will not behave the same as the case in the stack trace; the caller of |
Worked on this with @RyanCavanaugh and could not find a case that would locally repro. |
Maybe add the assert in the parser -- on finishing a jsx node, assert that the first child is not whitespace-only? |
Asserts in the parser would be bad. if they fail nothing will work in the program. at least with this assert, some operations work. |
@mhegazy Can we have informational-only asserts? We don't necessarily need to throw an exception, just report in telemetry that there was an error. |
but we have no way of getting the info really.. we log the failures, but the info can go to the log, and we have no way on getting that afterwards. |
We've been unable to generate a repro of this, so adding "Needs More Info". |
tsserver version: 2.6.1
hitting sessions: 6483
stack:
The text was updated successfully, but these errors were encountered: