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

Error reported when using in other code repositories, only py files can be recognized. Is there any way to use in other types of code repositories

Open hhn12138 opened this issue 1 year ago • 3 comments

This is a very excellent project, it would be better if it could run in a code repository other than Python

hhn12138 avatar Jul 01 '24 08:07 hhn12138

Thanks. Java is partly supported now. I also plan to add support for TypeScript and JavaScript.

aorwall avatar Jul 01 '24 14:07 aorwall

@aorwall I'm interested in running moatless on some TS/JS repos! Was curious if you had made any progress on this front?

If you already have something in the works but it's not final, I'd be happy to pick up where you left off and see if I can get it to work 😄

I'm guessing you would implement a javascript.py file under moatless/codeblocks/parser/?

I'm assuming the parser object creation here would also have to be updated.

Are there other places in the code to modify in order to make this work for new languages?

john-b-yang avatar Sep 12 '24 23:09 john-b-yang

I actually started adding support for JavaScript and TypeScript in an earlier version of Moatless Tools. It's not done yet, but I pushed the changes I made to the branch javascript-support #34. I haven’t tested running the agent on a JavaScript project yet though, and there are probably some hardcoded checks for Python. But at least it should give a bit of a hint on how the queries are implemented.

I should also mention that I built the parser when I was using the CodeBlocks implementation to edit the code. So, it's probably overly complicated now and has a lot of hacks to handle corner cases. My plan is to simplify it.

aorwall avatar Sep 14 '24 06:09 aorwall