-
Notifications
You must be signed in to change notification settings - Fork 72
Fix #88: Add TypeScript support #89
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
🚀 New features to boost your workflow:
|
| ("_allocQueue", "_allocQueue()", 70, 84), | ||
| ( | ||
| "_pushQueue", | ||
| "_pushQueue(\n char: number,\n repeat: number,\n line: number | undefined,\n column: number | undefined,\n filename: string | undefined,\n) {\n const cu", |
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.
It looks like signature includes part of the method body for _pushQueue (and other methods that have multi-line signatures).
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.
Oh yeah, this also looks sort of parsed incorrectly... Will simplify def signature, it's a little complicated now that I'm looking at it.
| @@ -0,0 +1,520 @@ | |||
| import type SourceMap from "./source-map.ts"; | |||
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.
I like to include the details of the original source in the commit when vendoring code for a fixture. I think it comes from here?
https://github.com/babel/babel/blob/ca998707a1c89da04aa849df9c340e06ce6da955/packages/babel-generator/src/buffer.ts
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.
Makes sense - did you mean adding a comment or something at the top of the file? Like
// Code from https://github.com/babel/babel/blob/ca998707a1c89da04aa849df9c340e06ce6da955/packages/babel-generator/src/buffer.ts
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.
I would normally just include it in the commit message where we add the 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.
Gotcha, I'll do that!
| _walk_and_collect_ts(child, entities, lines, file_path, max_entities) | ||
| return | ||
| elif node.type in [ | ||
| "function_declaration", |
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.
Do we test for function_declaration handling in the unit tests?
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.
Ah good point - hmm ok maybe i'll find a better testing file in terms of coverage.
I'm also a little tempted to just add some code to the end of this file. It would change the original source code, but might just be an easier solution. I'll think about this!
|
Leaving this PR open - if anyone wants to, please feel free to pick up where I left off! I think the implementation is close, it's just that the |
Adds TypeScript support, addresses #88.