aorwall / moatless-tools

MIT License
216 stars 20 forks source link

How can I make my project adaptable to other languages? #23

Open hhn12138 opened 2 months ago

hhn12138 commented 2 months ago

This project is excellent, and it would be great if it could be adapted to other languages. If i want to modify the project yourself to make it compatible with other languages, what are the main modifications i need to make?

aorwall commented 1 month ago

Thanks! The code is parsed to "CodeBlocks" using Treesitter, so the logic and prompts are agnostic to the programming language being used. What's needed is to add a new parser for the language and a Treesitter query file with definitions.

I've started on a Java parser which uses these treesitter queries.

JensRoland commented 1 month ago

You would also want to write an appropriate Verifier -- for Python it's using the PylintVerifier class which leverages Pylint, and for Java there's a MavenVerifier. You could fairly easily wrap a linter / checker for your chosen language by following those examples.