Skip to content
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

[feature] multiple languages in napi (JavaScript API) #845

Open
infi-pc opened this issue Jan 10, 2024 · 3 comments
Open

[feature] multiple languages in napi (JavaScript API) #845

infi-pc opened this issue Jan 10, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@infi-pc
Copy link

infi-pc commented Jan 10, 2024

⭐ Suggestion

Support in Javascript API all languages that are supported in CLI. Docs say @ast-grep/napi supports html, js, jsx, ts and tsx. but it would be cool if it supported all other languages from https://ast-grep.github.io/reference/languages.html

💻 Use Cases

I am building a NodeJS app that finds translation keys in many different codebases. Ast-grep would make it much easier than writing tree-sitter queries.

Note: I can help by contributing to JS/TS if I get the right directions.

@infi-pc infi-pc added the enhancement New feature or request label Jan 10, 2024
@HerringtonDarkholme
Copy link
Member

Hi thanks for using ast-grep. Building a tree-sitter parser in napi docker image is pretty challenging.

May I ask if it is possible to use https://ast-grep.github.io/guide/api-usage/py-api.html python API?

@infi-pc
Copy link
Author

infi-pc commented Jan 10, 2024

aha, thanks :) Python is too inconvenient for my current use case; sticking with just a tree-sitter query is easier for now, but maybe later :)

I also plan to explore running it in a browser for my next use case; it seems to be possible from checking the playground repo. Btw. do you plan to publish ast-grep-wasm with some docs? It would be super cool.

@HerringtonDarkholme
Copy link
Member

ast-grep-wasm is on the roadmap! But I don't have a precise timeline since there will be pretty many work there :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants