diff --git a/src-lsp/LspShims.ml b/src-lsp/LspShims.ml index e79cb07..24f49e0 100644 --- a/src-lsp/LspShims.ml +++ b/src-lsp/LspShims.ml @@ -10,11 +10,7 @@ struct let lsp_range_of_range (r : Asai.Range.t option) = match r with | Some r -> - let (start , stop) = - match Asai.Range.view r with - | `Range (start, stop) -> start, stop - | `End_of_file pos -> pos, pos - in + let (start, stop) = Asai.Range.split r in L.Range.create ~start:(lsp_pos_of_pos start) ~end_:(lsp_pos_of_pos stop) diff --git a/test/TestTty.ml b/test/TestTty.ml index 72e99f1..b90da4d 100644 --- a/test/TestTty.ml +++ b/test/TestTty.ml @@ -79,9 +79,9 @@ let exec handler = Loctext.make ~loc:(Range.make (~@ s2 10 0, ~@ s2 10 0)) "message 8"; ]; - Reporter.emit ~loc:(Range.eof (~@ s1 23 width)) Hello "this is the main message" + Reporter.emit ~loc:(Range.make (~@ s1 23 width, ~@ s1 23 width)) Hello "this is the main message" ~extra_remarks:[ - Loctext.make ~loc:(Range.eof (~@ s2 23 width)) "ending of another file"; + Loctext.make ~loc:(Range.make (~@ s2 23 width, ~@ s2 23 width)) "ending of another file"; ] let () =