jon.recoil.org

Module Merlin_kernel.Msource

type t

Merlin representation of a textual source code

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

module Digest : sig ... end

Minimal Digest utilities around t

val make : string -> Merlin_kernel.Msource.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 : Merlin_kernel.Msource.t -> [< Merlin_kernel.Msource.position ] -> [> `Offset of int ]
val get_logical : Merlin_kernel.Msource.t -> [< Merlin_kernel.Msource.position ] -> [> `Logical of int * int ]
val get_lexing_pos : Merlin_kernel.Msource.t -> filename:string -> [< Merlin_kernel.Msource.position ] -> Stdlib.Lexing.position

Managing content

Updating content

val text : Merlin_kernel.Msource.t -> string

Source code of the file

val print_position : unit -> [< Merlin_kernel.Msource.position ] -> string