-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Extract to typedef from (invalid) type with comments in JS file causes assertion failure #48540
Comments
I was encountering a similar error in #48112 due to new synthetic nodes being added as a result of processing text changes. I fixed the case I ran into using this: https://github.com/microsoft/TypeScript/pull/48112/files?show-viewed-files=true&file-filters%5B%5D=#diff-386d93db50a938da0c4af7bb293ac679b5da235cebeeee9adbc040fbf8aa222cR1128-R1136 I'll have to check whether the issues are related. |
That link seems to have issues on my end - can you hard-link to the line range of the file? |
TypeScript/src/services/textChanges.ts Lines 1128 to 1136 in 01b9a2d
|
The problem is that the |
Is it a parenthesization issue? It seems more like it's specific to putting a comment inside of a comment. The fix that @MQuy has at #48545 of just dropping the comments fixes the specific tests at a shallow level, but would fail any deeper. Is there a way to turn off comment trivia emit for an entire subtree? That would probably be an ideal fix, but admittedly I'm not familiar with the transform pipeline anymore. |
I thought it may have been due to a ParenthesizedType node being silently added to the type, but that does not seem to be the case here.
Yes, you can set |
Thank you @MQuy! |
Looks like there's still an issue when triggering the command from inside of a comment (#48593). |
Request "extract to typedef" on each
[|region|]
.The text was updated successfully, but these errors were encountered: