-
Notifications
You must be signed in to change notification settings - Fork 53
fix(codemod-sandbox): Replace row with line in JsPosition to match the types from @ast-grep/napi #1655
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
Conversation
@brunocroh is attempting to deploy a commit to the Codemod Team on Vercel. A member of the Team first needs to authorize it. |
Thanks for pointing that out! Good catch. I believe the change should be made in the Rust code instead. Let me know if you’d like to update the PR or if you need any assistance. |
Okay, so I dropped the previous commit and pushed a new one. Now I'm updating the JsPosition object to replace row with line. Let me know if anything else needs to be done, thank you. |
Thank you! I tested these changes and it all looks good. Waiting for CI 👀 |
commit: |
Thank you so much! These changes will be included in the next release which would be |
Brilliant, thank you mate! |
@all-contributors add @brunocroh for code |
I've put up a pull request to add @brunocroh! 🎉 |
If you'd like to open a PR and I'll take care of any polishes required, that would be amazing. Thanks, @brunocroh! |
📚 Description
The type
Position
in @codemod.com/jssg-types differs from what is returned in Range objects in JavaScript.Looking at the ast-grep Rust implementation, the line is returned as row there. If this change needs to be made in the Rust code rather than in the type definitions, please let me know, I’d be happy to contribute to the Rust code (I tried to run it but had some issues setting up the development environment, so I’ll need some help with it. I can also use this opportunity to document how to setup development environment in the CONTRIBUTING.md).
codemod/crates/codemod-sandbox/src/ast_grep/sg_node.rs
Lines 154 to 165 in 6578c16
🔗 Linked Issue
nodejs/userland-migrations#136