-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Added TypeScript 3.9 support, switched implementation to ts-morph #5
Conversation
Thanks I’ll take a look later, but I definitely don’t want the yarn lock file 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the extra tests definitely (I was a bit lazy regarding those). I'm not really keen to introduce a dependency for this plugin though... can we figure out what ts-morph
does differently and just do it the same way instead?
BTW just wondering, if this works with ts-morph
, then maybe we're just missing something in the ServiceHost
? I feel like there's a simpler fix... will investigate!
I guess that's fair, but given this is local tooling I didn't think it would be a huge issue to add a long standing and well-maintained TS higher level API wrapper. I had already spent a lot of time tracking down whether the problem came from TS itself, Prettier, this plugin, or even elsewhere; I was looking for a way to fix it hehe. I haven't managed to reproduce the issue in the TS test suite either.
Possibly. It could be something in: Thank you! |
I've just figured out that it doesn't happen if there isn't a new line:
This passes 🤷🏻♂️ I've tried adding |
Funny, these also pass: import { foo,
bar, baz } from "foobar"; import {
foo,
bar, baz } from "foobar"; import {
foo,
bar, baz
} from "foobar"; |
Ok I figured it out... if I pass |
@mathieumg I kind of tracked it down inside Typescript: This line returns a set of changes like this:
and those two undefined I can't really tell whether the mistake lies in the fact that |
I wonder if it could be related to microsoft/TypeScript@237ea52 which was for https://devblogs.microsoft.com/typescript/announcing-typescript-3-9/#preserve-newlines |
The root bug is actually in Typescript: microsoft/TypeScript#38548 Closes #5.
Let me know what you think. Normally all 5 commits are cherry-pickable if there are things you don't want.
See microsoft/TypeScript#38548