Skip to content

Commit

Permalink
refactor(lsp): remove Text_document.Expert (#1094)
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
rgrinberg committed May 12, 2023
1 parent 62f8c4e commit e81d16a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
8 changes: 0 additions & 8 deletions lsp/src/text_document.ml
Expand Up @@ -119,11 +119,3 @@ let absolute_range t (range : Range.t) =
in
let stop = String_zipper.offset zipper in
(start, stop)

module Expert = struct
let goto t pos =
let zipper = String_zipper.goto_position t.zipper pos `UTF8 in
{ t with zipper }

let offset t = String_zipper.offset t.zipper
end
12 changes: 0 additions & 12 deletions lsp/src/text_document.mli
Expand Up @@ -44,15 +44,3 @@ val absolute_position : t -> Position.t -> int
(* [absolute_range t range] same as [(absolute_position t range.start ,
absolute_position t range.end_)] but possibly faster *)
val absolute_range : t -> Range.t -> int * int

module Expert : sig
(** These functions allow one to work with the underlying zipper. This gives
the opportunity for better performance on chained edits. *)

(** [goto t pos] move the zipper of [t] to [pos]. [pos] must be in utf8 *)
val goto : t -> Position.t -> t

(** [offset t] return the global offset in the string where the zipper is
currently focused *)
val offset : t -> int
end

0 comments on commit e81d16a

Please sign in to comment.