typescript-go icon indicating copy to clipboard operation
typescript-go copied to clipboard

pretty-printing reparsed JS nodes crashes on GetTypeNodePrecedence

Open sandersn opened this issue 7 months ago • 3 comments

Reparsed JS nodes shouldn't normally be pretty-printed, but if they are, they shouldn't crash.

Specifically, @weswigham has seen crashes in GetTypeNodePrecedence with JSDocTypeExpression and JSDocTypeLiteral. JSDocTypeExpression can show up on a JSTypeAlias.

I don't know if Strada has tests that cover this, but Corsa definitely doesn't have them yet.

sandersn avatar May 01 '25 21:05 sandersn

Hey @sandersn , I'd be happy to take a look and see if I can help resolve this. Is someone already working on it, or would you welcome a contribution? Let me know!

vasusheoran avatar May 02 '25 21:05 vasusheoran

You can, but I won't be much help because I haven't learned myself exactly what the scope of the problem is. And there aren't any tests that cover it yet.

I'm likely to get to this eventually; I suspect @rbuckton will point out the problem in one of my upcoming PRs and tell what to do to fix it. =)

sandersn avatar May 02 '25 21:05 sandersn

ack, I'll play around this weekend. Let me know if you get any updates in the meantime.

vasusheoran avatar May 05 '25 16:05 vasusheoran

Is this fixed by now?

jakebailey avatar Jun 04 '25 07:06 jakebailey