package loc

  1. Overview
  2. Docs

Module Loc.File_cacheSource

When locations are created manually, such as from a given line number, to compute all the actual positions and offsets we need to access the original contents of the file and locate new lines characters in it. This cache serves this purpose.

Sourcetype t
Sourceval path : t -> Fpath.t

Return the path that was used to create the cache.

Sourceval create : path:Fpath.t -> file_contents:string -> t

Create a cache from the name of a file and its contents.