At least for now, the repository is unmaintained.
This plugin is providing support for OCaml for JetBrains IDEs. It's based on both ReasonML and intellij-rust. If you are looking for a complete and maintained solution, please check out the ReasonML plugin (that is based on ocaml-ide btw). I'm a student, and I'm lacking the knowledge to do something great.
Getting Started 🗺️ | Features 🚀
The goal is to have a plugin similar to VSCode with OCaml LSP server, but without the LSP server as it is not fully available for plugin developers yet, and as it exclusive to paid users.
Base features (✅ = YES, ❌ = No/Not yet, 🆗 = Must compile first)
OCaml | ReasonML | VSCode | VSCode LSP | |
---|---|---|---|---|
Highlighter | ✅ | ✅ | ✅ | ✅ |
Find Usages | ❌ | ✅ | ❌ | ✅ |
Type inference (codelens) | ❌ | ❌ | ❌ | ✅ |
Type checking | ❌ | ❌ | ❌ | ✅ |
Autocompletion | ❌ | ✅ | ✅1 | ✅ |
Live Templates/Snippets | ✅ | ✅ | ✅ | ✅ |
Debugging | ❌ | ? | ? | ? |
Navigation 2 | ✅3 | ✅ | ❌ | ✅ |
Warnings | ❌ | ❌ | ❌ | ✅ |
Error | ❌ | ❌ | ❌ | ✅ |
1 Autocompletion is not context sensitive
2 From a function/type/etc. to its declaration/implementation
3 Minimal support (only for functions, and not all function calls)
Build Systems (✅ = Triggered from the editor, ❌ = Manually, 🆗 = Using An External Plugin, 😓 = Syntax Highlight Only)
OCaml | ReasonML | VSCode | VSCode (LSP) | |
---|---|---|---|---|
Native Build | ❌ | ❌ | ❌ | ❌ |
Dune integration | ✅ | 😓 | ❌ | ✅ 3 |
Makefile integration | ? | ? | ? | ? |
REPL integration | ❌ | ❌ | ✅ | ✅ |
3 Run "build task" and select which dune file to build.
IntelliJ Features
OCaml | ReasonML | VSCode | VSCode LSP | |
---|---|---|---|---|
Structure/Outline View | ✅ | ✅ | ❌ | ✅ |
Spell-checker | ✅ | ✅ | ❌ | ❌ |
Braces Matching | ✅ | ✅ | ✅ | ✅ |
Comment Handler (line/block) | ✅ | ✅ | ✅ | ✅ |
Navigate to declaration | ✅ | ✅ | ❌ | ✅ |
Navigate to implementation | ✅ | ✅ | ❌ | ✅ |
Refactoring | ❌ | ? | ❌ | ✅ |
UML Generation | ❌ | ❌ | ❌ | ? |
Parser Recovery 4 | ✅ | ❌ | ❌ | ✅ |
4 The ability of the plugin to function with a file that doesn't compile
External Dependencies Integration
OCaml | ReasonML | VSCode | |
---|---|---|---|
Opam | ❌ | ✅ | ✅ |
OCamlFormat | ❌ | ✅ | ✅ |
- Can run/compile ocaml files (without having to install some external build system)
- Support for opam (can install / update packages, ...)
- Support for Makefile
- Support for Dune
- Any installation must be simple, and effortless
- Real-time checks for errors/warnings, including quick fixes. Can suppress warnings.
- Real-time type inference
- Smart auto-completion
- REPL support: we must be able to send commands from our file, to a REPL console
- Using a bundle (possible support for Localization later)
- Working in minor IDEs (CLion, PHPStorm, etc.)
To update the gradle project to the latest version:
- The plugin is based on the official template
- Manually check important files for changes (
build.gradle.kts
,gradle/libs.versions.toml
,gradle/wrapper/gradle-wrapper.properties
, etc.)
To build the plugin (🪦 please make this easier...):
- Download the project and run a gradle build
- Locate
OCaml.bnf
and generate OCamlParser - Locate
OCaml.bnf
and use the commented outparserClass
and the commented outunit_interface
instead of the currentparserClass
andunit_implementation
(respectively). This will generate the OCamlInterfaceParser - Locate
Dune.bnf
and generate DuneParser - Locate
_OCamlLexer.flex
to generate _OCamlLexer - Locate
_DuneLexer.flex
to generate _DuneLexer - Locate
_odoc.flex
to generate _OdocLexer - You can now use
Run Plugin
This project is MIT licensed.