Skip to content

This plugin is providing support for OCaml in IntelliJ. It's based on ReasonML and intellij-rust. If you are looking for a complete and maintained solution, please check the ReasonML plugin.

License

Notifications You must be signed in to change notification settings

QuentinRa/intellij-ocaml

Repository files navigation

intellij-ocaml

Checks Version Downloads License: MIT Dependabot: Active 0.2.0 0.3.0 0.4.0 0.5.0 0.6.0 0.7.0

At least for now, the repository is unmaintained. No Maintenance Intended

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 🚀

Plugin Features Overview

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

🎯 What's my goal?

  • 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.)

🛣️ Project Notes

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 out parserClass and the commented out unit_interface instead of the current parserClass and unit_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

📄 License

This project is MIT licensed.

About

This plugin is providing support for OCaml in IntelliJ. It's based on ReasonML and intellij-rust. If you are looking for a complete and maintained solution, please check the ReasonML plugin.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Contributors 2

  •  
  •