Module Chamo.Mode_ocaml

Sourceview mode for Objective-Caml files.

val remove_first_blanks : string -> string

Remove the ehading blanks of a given string.

val indent_line : Sourceview.sourceview -> string array -> unit

Indent the current line of the given sourceview. This is the code of the "ocaml_indent_line" command.

val indent_buffer : Sourceview.sourceview -> string array -> unit

Indent the whole buffer of the given sourceview. This is the code of the "ocaml_indent_buffer" command.

val switch_file : Sourceview.sourceview -> string array -> unit Lwt.t

Open the interface (respectively the implementation) of the ocaml implementation (resp. interface) file in the given sourceview. Does nothing if the file does not have ".ml" or ".mli" extension. This is the code of the "ocaml_switch_file" command.

val cmt_file_build_dir_max_parent_level : int Stdlib.ref

This variable indicates how many levels up to search for a _build directory to when looking for a .cmt file.

val display_type_annot : Sourceview.sourceview -> string array -> unit

If the file in the given sourceview is a ".ml", then lookup for the corresponding ".annot" file and search in it for type annotation corresponding to the current position in the buffer. If an annotation is found, highlight the part of the source code corresponding to the type annotation and display the type annotation in the minibuffer of the sourceview's window. If an errors occurs (no type annotation found or ".ml" file modified since the creation of the ".annot" file, for example), a message is displayed in the minibuffer. This is the code of the "ocaml_display_type_annot" command.

val copy_type_annot : Sourceview.sourceview -> string array -> unit

Same as display_type_annot but also copy the type in the main clipboard.

Same as display_type_annot but display call annotation.

val display_call_annot : Sourceview.sourceview -> string array -> unit

val display_ident_annot : Sourceview.sourceview -> string array -> unit

Same as display_type_annot but display ident annotation.

val jump_to_local_def : Sourceview.sourceview -> string array -> unit

Same as display_ident_annot but in case of a local ident (that is, defined in the file), jump to the ident definition.

val mode : Sourceview.mode

The mode.