I am happy to announce “Emacs OCaml IDE,” built on Emacs IDE Frametools. Shown below are screenshots of a proof of concept build of Emacs OCaml IDE. This work pulls together a number of editing modes already available for Emacs and makes their functionality available in a graphical environment. Among the features working so far are code browsing, a context sensitive toolbar and a stepping debugger.
Detailed Feature List
- Syntax highlighting & code browsing using outline mode
- Build using make and OCamlMakefile
- Tab trigged completion support
- “Grok”ing the code base via “ack-grep”
- Stepping debugger integration – setting breakpoints via GUI, inspecting variables, etc.
- Context sensitive right-click support…
- On-the-Fly Intelligent Error Highlighting As-You-Type
The main motivation was to create something that would leverage the excellent OCaml support in Tuareq but also provide IDE elements that people tend to be familiar with. The OCamlEditor project provides an excellent code editor, but misses an integrated debugger & the Eclipse plugin provides integrated debugging, but misses the depth of features that come with Emas Tuareg mode.
Although Emacs users tend to frown upon the “guyfication” of their editor, there are many users that find Emacs inaccessible precisely because it misses modern GUI appeal. Not principally an OCaml programmer myself, I put this together principally “for fun” and am looking for a maintainer for this project. If interested, please contact me at firstname.lastname@example.org.
Code Browsing, Tabbed Editing & Syntax Highlighting
The top left two toolbar buttons control what is displayed.
The far right button starts the OCaml build process.
On-the-Fly Intelligent Error Highlighting As-You-Type
The edit area will automatically highlight errors as you type and indicate any associate error message in the echo area, here: Unbound value xlet.
Code “Grok” via Ack-Grep
This feature allows in place editing in *ack* buffer and writing back to underlying buffer set.
I found this useful in refactoring though it is not strictly OCaml specific.
The toolbar is context sensitive so, for example, the “watch” icon (set of glasses) appears only as I click on the definition of “pi” in the source view on the left with the debugger activated on the right.
Context Sensitive Right-Click Support
This includes a strictly limited set of options at the moment but is extensible.
Selecting “Show type at point” over the variable Pi thus displays the following in the Emacs echo area:
Easy Integration with Emacs
Written in Emacs Lisp
All-up 700 lines of Lisp…
- flymake – for On-the-fly intelligent error highlighting in Ocaml
- mouse3 -for context sensitive right-click support
- imenu -symbol outlining
- camldebug – contained in caml package
- Embed icons in Emacs Lisp as text and write them out to a default location on startup to avoid dependency on manual installation of icons. Emacs IDE Frametools works this way.
- Make both Emacs IDE Frametools and OCaml IDE available under EPAL package manager
- Make various behaviours tunable as package custom variables so that the Emacs customization mechanism may be used.
- Integrate support to Ocaml Merlin
- Fix Integrated Help (F1) support
Released under the GPL