-
-
Notifications
You must be signed in to change notification settings - Fork 193
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] Java rule contains invalid kind matcher despite working on playground #1648
Comments
@HerringtonDarkholme I saw the FAQ, but based on the ast-grep help, it seems
would it be possible to have a flag for the CLI to run in either mode or is that too involved of a change?
thank you for the parser update. would it be possible to list the parser version on the playground (even if need to hover over an info icon) so that the same environment could be recreated locally in a fork, if needed? |
The issue is different parser version so you can use your source code as pattern to debug parser related issues.
No, this is an inherent issue in tree-sitter's library. tree-sitter wasm is a standalone library that uses utf-16 and has different heuristics. Using utf-16 does not help on CLI and it is probably not you want. The encoding error only happens when you have wrong pattern code, which you should not use anyway.
It isn't possible for now since all wasm files are updated manually (more precisely, some wasm files are downloaded from tree-sitter playground which don't have parser version) tree-sitter also has the same issue tree-sitter/tree-sitter#3449 I have created an issue in ast-grep/ast-grep.github.io#605. While I don't have the capacity for it, open source contribution is warmly welcome! |
Please read the FAQ for the bug you encountered.
⏯ Playground Link
https://ast-grep.github.io/playground.html#eyJtb2RlIjoiQ29uZmlnIiwibGFuZyI6ImphdmEiLCJxdWVyeSI6IiIsInJld3JpdGUiOiIiLCJzdHJpY3RuZXNzIjoic2lnbmF0dXJlIiwic2VsZWN0b3IiOiIiLCJjb25maWciOiJpZDogc3VwZXJ0eXBlcy1qYXZhXG5sYW5ndWFnZTogamF2YVxucnVsZTpcbiAgYW55OlxuICAgIC0ga2luZDogdHlwZV9pZGVudGlmaWVyXG4gICAgLSBraW5kOiBzY29wZWRfdHlwZV9pZGVudGlmaWVyXG4gICAgLSBraW5kOiBnZW5lcmljX3R5cGVcbiAgaW5zaWRlOlxuICAgIGFueTpcbiAgICAgIC0ga2luZDogaW50ZXJmYWNlX3R5cGVfbGlzdFxuICBwYXR0ZXJuOiAkTkFNRSIsInNvdXJjZSI6ImNsYXNzIE15Q2xhc3MxXG4gICAgXG5jbGFzcyBNeUNsYXNzMiB7IH1cblxuY2xhc3MgTXlDbGFzczMgZXh0ZW5kcyBQYXJlbnRDbGFzcyB7IH1cblxuY2xhc3MgTXlDbGFzczM1IGV4dGVuZHMgUGFyZW50Q2xhc3MuSW1wbCB7IH1cblxuY2xhc3MgTXlDbGFzczM1MiBleHRlbmRzIFBhcmVudENsYXNzLkltcGw8VHlwZT4geyB9XG5cbmNsYXNzIE15Q2xhc3M0IGltcGxlbWVudHMgTXlJbnRlcmZhY2UgeyB9XG5cbmNsYXNzIE15Q2xhc3M0NSBpbXBsZW1lbnRzIE15SW50ZXJmYWNlLkltcGwgeyB9XG5cbmNsYXNzIE15Q2xhc3M0NTIgaW1wbGVtZW50cyBNeUludGVyZmFjZS5JbXBsPFR5cGU+IHsgfVxuXG5jbGFzcyBNeUNsYXNzNSBleHRlbmRzIFBhcmVudENsYXNzIGltcGxlbWVudHMgTXlJbnRlcmZhY2UgeyB9XG5cbmNsYXNzIE15Q2xhc3M2IGV4dGVuZHMgUGFyZW50Q2xhc3MgaW1wbGVtZW50cyBNeUludGVyZmFjZTEsIE15SW50ZXJmYWNlMiB7IH1cblxuY2xhc3MgTXlDbGFzczdcbiAgICBleHRlbmRzIFBhcmVudENsYXNzXG4gICAgaW1wbGVtZW50cyBNeUludGVyZmFjZTEsXG4gICAgTXlJbnRlcmZhY2UyIHsgfVxuIn0=
💻 Code
Rule:
~/supertypes-java.yaml
to match every java interface a class implements🙁 Actual behavior
🙂 Expected behavior
Expected to match java interfaces on class declarations as in the Playground link which shows proper matches
Additional information about the issue
Tried using ast-grep v0.30.0 and v0.31.0
The text was updated successfully, but these errors were encountered: