-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat: Implement sourcemap composition #67
Conversation
This reverts commit 0edf07f.
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.
only a partial review. this is very hard to digest.
how does it compare with other imlementations that exist in the JS ecosystem?
I know. Thank you for your comments :)
I'll do my best to understand at least |
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 believe the implementation is good, it just needs some better naming and docs.
Instead of left/right, give the two sourcemaps a descriptive name.
We have a very narrow usecase here, we are just injecting a snippet into an already sourcemapped file. Or are we creating a generic solution?
You're right that the use case is very narrow. I'll try to think of more descriptive names! |
This PR now includes test cases for debug id injection (the intended use case) as well as a property-based test showing the following: |
let line_offset = line * 11; | ||
match self { | ||
FirstEdit::Insert(col, s) => { | ||
ms.append_left(line_offset as u32 + *col, s).unwrap(); |
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.
Dereferencing in math operations is always so ugly 😅
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.
One of the papercuts of Rust :/
No description provided.