moatless-tools icon indicating copy to clipboard operation
moatless-tools copied to clipboard

How can I make my project adaptable to other languages?

Open hhn12138 opened this issue 1 year ago • 2 comments

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?

hhn12138 avatar Jul 09 '24 03:07 hhn12138

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.

aorwall avatar Jul 09 '24 17:07 aorwall

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.

JensRoland avatar Jul 09 '24 18:07 JensRoland