-
-
Notifications
You must be signed in to change notification settings - Fork 164
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
[bug] napi.findFiles() issue: SgNode for file A apparently references text from file B #1380
Comments
Can you also share the file you are scanning? ast-grep -p 'yup.object($OBJ)' -l ts this command should help you find the file |
There should be several ways to debug this issue:
You can try reduce the issue by deleting files in the repo and find the minimal reproduction. |
running into a similar issue. i ran this on my codebase and got the same error message as the original issue. I get a segfault when trying to
This gives
|
@harrisonzhu-db would you like to provide a minimal reproduction? Usually it can be done by deleting scanned code.
|
the bug should be self-contained within the code I pasted - the script is using ast-grep to scan itself, so that should be all you need |
Thanks for the report. I found the root issue now. |
very awesome! thanks for this |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [ast-grep/ast-grep](https://github.com/ast-grep/ast-grep) | patch | `0.26.1` -> `0.26.2` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>ast-grep/ast-grep (ast-grep/ast-grep)</summary> ### [`v0.26.2`](https://github.com/ast-grep/ast-grep/blob/HEAD/CHANGELOG.md#0262) [Compare Source](ast-grep/ast-grep@0.26.1...0.26.2) - fix: readopt matched metavar in napi [`#1380`](ast-grep/ast-grep#1380) - chore: update napi definition [`07e084a`](ast-grep/ast-grep@07e084a) - fix(deps): update dependency [@​swc/core](https://github.com/swc/core) to v1.7.11 [`835b06f`](ast-grep/ast-grep@835b06f) - fix(deps): update dependency [@​swc/core](https://github.com/swc/core) to v1.7.10 [`d7a3820`](ast-grep/ast-grep@d7a3820) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Idea: use ast-grep napi programmatically.
💻 Code
crash messages are like this:
🙁 Actual behavior
See comments in the code above
🙂 Expected behavior
The code above should print the correct source code.
The text was updated successfully, but these errors were encountered: