-
Notifications
You must be signed in to change notification settings - Fork 197
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
Does Piranha support scala projects #199
Comments
You can potentially add rules for Scala and make Piranha applicable for Scala. See here |
@eankit you can use https://github.com/tree-sitter/tree-sitter-scala for the grammar. I think the rules will be very similar to the ones implemented for Java/Kotlin. |
can some help with how to and where to make changes in .rs files in the polygot piranha. I understand the .toml file syntaxes but it seems a lot goes into .rs files before it could be used in the toml file. |
@eankit adding new language support requires very minimal changes After this merges, it should be easy (though slightly tedious) to add scala support. I will update the README and keep you posted. Basically you will have to do the following:
|
Hey @ketkarameya _Building wheels for collected packages: polyglot_piranha × Building wheel for polyglot_piranha (pyproject.toml) did not run successfully.
note: This error originates from a subprocess, and is likely not a problem with pip. |
I assume you get this error on adding the tree-sitter-scala right? I think there is a tree sitter version mismatch. How have u added it in Cargo.toml? Can you add the GitHub repo link there (like tree-sitter-java ) |
@ketkarameya I have added the it in Cargo.toml, I have added the one mentioned above - |
@ketkarameya upon fetching the latest pull from master, I am getting this error without adding scala. This error is coming for typescript also up doing a pip install . |
But the CI is passing . What machine are you using ? ubuntu /mac / windows? |
I am on my local mac |
So you are able to build the application locally (with no changes)? |
no I have to make some change to run it locally, if I remove typescript from your code/master it is building code correctly |
@ketkarameya after making the below change I am able to run the pip install . successfully diff --git a/polyglot/piranha/src/models/language.rs b/polyglot/piranha/src/models/language.rs
|
I am using a Mac too. I did the following
Are you doing the same? |
I am following these steps git clone https://github.com/uber/piranha.git |
however running cargo build --no-default-features also gives me the following error, not sure what I am doing wrong ? error[E0308]: mismatched types error[E0308]: mismatched types For more information about this error, try |
Can you please try |
@ketkarameya I wish I could share my screen anbhanda@Ankits-MacBook-Pro-6 piranha % git status nothing to commit, working tree clean error[E0308]: mismatched types For more information about this error, try |
hmmm. Let me think. Can you see if installing tree-sitter cli help? |
Also can you start in a fresh directory?
I think |
@ketkarameya |
Hey! I think once u add that struct for scala you will need to write rules (no more rust changes) |
It compiles will with adding scala dependency in cargo.toml file but compilation fails with following error anbhanda@-MacBook-Pro-6 piranha % cargo build --release --no-default-features For more information about this error, try |
Yes, I is a tree-sitter version mismatch. So we (Piranha) is using I would recommend upstreaming the version update change for tree-sitter scala to something like this. |
This latest PR adds built-in cleanup rules for Go. You can use it as reference :) |
@ketkarameya thanks a lot, forking scala tree-sitter worked. |
Hmmm. yea. |
@eankit. Can you create a PR for just adding Scala to Piranha ? |
Does Piranha have support for scala with current code or can it be supported with minimalistic changes in java?
The text was updated successfully, but these errors were encountered: