Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to conveniently refactor OCaml project?

Tags:

ocaml

I am using Emacs + Tuareg mode to do my OCaml project.

It is working fine and I get used to it.

However, along with my project source base getting bigger and bigger, I find managing the project is getting harder and harder.

Especially for refactoring. If I change a module name or function name, I have to search everywhere for the part that need to changed accordingly or I just constantly compile again and again to let compiler tell me where I should go.

It is not convenient.

Anyone can suggest a good way for source base management?

thanks

like image 412
Jackson Tale Avatar asked Jun 20 '13 19:06

Jackson Tale


1 Answers

A good option is TypeRex. This is an alternative Emacs mode created by OCamlPro that has a bunch of OCaml-aware features including proper support for refactoring (like renaming identifiers).

It also has a bunch of other nice features like good auto-complete, semantic grep and so on.

Unfortunately, this involves changing your build process to use some wrapper programs. These generate the additional information the mode needs to function. However, once you get the build set up, it's a really awesome editing environment.

like image 111
Tikhon Jelvis Avatar answered Sep 20 '22 15:09

Tikhon Jelvis