package merlin-lib

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t

Merlin representation of a textual source code

It bundles filename and a content, and offers functions for computing positions in the source.

val make : string -> t

Making a content from name and contents.

Position management

type position = [
  1. | `Start
  2. | `Offset of int
  3. | `Logical of int * int
  4. | `End
]
val get_offset : t -> [< position ] -> [> `Offset of int ]
val get_logical : t -> [< position ] -> [> `Logical of int * int ]
val get_lexing_pos : t -> filename:string -> [< position ] -> Lexing.position

Managing content

val substitute : t -> [< position ] -> [< position | `Length of int ] -> string -> t

Updating content

val text : t -> string

Source code of the file

val dump : t -> Merlin_utils.Std.json
val print_position : unit -> [< position ] -> string
OCaml

Innovation. Community. Security.