Skip to content
This repository has been archived by the owner on Nov 2, 2019. It is now read-only.

Sublime Text plugin which provides OCaml autocompletion with ocp-index

License

Notifications You must be signed in to change notification settings

whitequark/sublime-ocp-index

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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+a shortcut, 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.

About

Sublime Text plugin which provides OCaml autocompletion with ocp-index

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages