OCaml Autocompletion
Sublime Text plugin which provides OCaml autocompletion with ocp-index
Details
Installs
- Total 4K
- Win 1K
- Mac 1K
- Linux 1K
| Apr 1 | Mar 31 | Mar 30 | Mar 29 | Mar 28 | Mar 27 | Mar 26 | Mar 25 | Mar 24 | Mar 23 | Mar 22 | Mar 21 | Mar 20 | Mar 19 | Mar 18 | Mar 17 | Mar 16 | Mar 15 | Mar 14 | Mar 13 | Mar 12 | Mar 11 | Mar 10 | Mar 9 | Mar 8 | Mar 7 | Mar 6 | Mar 5 | Mar 4 | Mar 3 | Mar 2 | Mar 1 | Feb 28 | Feb 27 | Feb 26 | Feb 25 | Feb 24 | Feb 23 | Feb 22 | Feb 21 | Feb 20 | Feb 19 | Feb 18 | Feb 17 | Feb 16 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
OCaml autocompletion for Sublime Text
Installation
opam install ocp-index
Usage
Within OCaml syntax files:
- Standard sublime autocompletion is completely replaced with OCaml autocompletion
- Type inspection of variables is available via the
alt+ashortcut, which displays the type in the status bar
Build configuration
You need to pass the -bin-annot flag to ocamlc/ocamlopt. You are probably using a build system, so follow the guide below.
If you are not using one of the standard build output folders then a setting is available to pass the --build parameter to ocp-index:
"sublime_ocp_index_build_dir": "gen/ml"
This setting can be applied as a user preference or (recommended) in your .sublime-project file.
ocamlbuild
Ocamlbuild 4.01 supports generating binary annotations out of the box, with the bin_annot tag. In your _tags:
true: bin_annot
For earlier versions of Ocamlbuild, this can be replicated by adding one line to myocamlbuild.ml:
flag ["ocaml"; "compile"; "bin_annot"] (A"-bin-annot");
License
The MIT License
A note about ocp-index versions
This plugin uses ocp-index -I <folder> to enable searching local project libraries. Prior to the 1.0.2 release, this disabled searching OPAM libraries. To show OPAM libraries in autocomplete results with this version, use the following setting:
"sublime_ocp_index_include_local_packages": false
This can be applied globally in your user settings or overridden in a .sublime-project file.