Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSP improvements #13

Merged
merged 17 commits into from
Oct 2, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Extract preprocessor logs into a dedicated module
This also comes with various refactorings here and there.
nberth committed Sep 29, 2023
commit 113beb15bf2769db5d5f03c7ba8f6f61ce24f984
26 changes: 6 additions & 20 deletions src/lsp/cobol_common/srcloc.ml
Original file line number Diff line number Diff line change
@@ -57,6 +57,9 @@ module TYPES = struct
(* ... but forbids other cats directly on its right. *)
and right_ = [raw_|cpy_|rpl_]

(** Sets of copied libraries *)
type copylocs = copyloc list

(** Values attached with a source location. *)
type 'a with_loc = { payload: 'a; loc: srcloc [@compare fun _ _ -> 0] }
[@@ deriving ord]
@@ -644,23 +647,6 @@ let copy_from ~filename ~copyloc { payload; loc } =

(* --- *)

module COPYLOCS = struct
(** Helper to record and format chains of copied libraries. *)

type t = copyloc list (* reversed *)

let none: t = []
let append ~copyloc filename : t -> t = List.cons { filename; copyloc }
let mem: string -> t -> bool = fun f ->
List.exists (fun { filename; _ } -> filename = f)

end

(* TODO: move me to a better place. This type declaration has to be
shared by Common_ast and Common_preproc *)
(* NB: not necessarily. One refers to pre-processing concept, the other to the
semantics of some COBOL statements like INSPECT or EXAMINE. *)
type leading_or_trailing =
| Leading
| Trailing
[@@deriving show, ord]
let no_copy: copylocs = []
let new_copy ~copyloc filename = List.cons { filename; copyloc }
let mem_copy f = List.exists (fun { filename; _ } -> filename = f)
19 changes: 7 additions & 12 deletions src/lsp/cobol_common/srcloc.mli
Original file line number Diff line number Diff line change
@@ -14,13 +14,14 @@
module TYPES: sig
type lexloc = Lexing.position * Lexing.position
type srcloc
type 'a with_loc = { payload: 'a; loc: srcloc; }
[@@deriving ord]
type copylocs
type 'a with_loc = { payload: 'a; loc: srcloc; } [@@deriving ord]
end
type lexloc = TYPES.lexloc
type srcloc = TYPES.srcloc
type copylocs = TYPES.copylocs
type 'a with_loc = 'a TYPES.with_loc =
{ payload: 'a; loc: srcloc; } [@@deriving ord]
{ payload: 'a; loc: srcloc; } [@@deriving ord]

module INFIX: sig
(* Meaning of letters:
@@ -107,12 +108,6 @@ val concat_locs: _ with_loc list -> srcloc option
val concat_strings_with_loc: string with_loc -> string with_loc -> string with_loc
val copy_from: filename:string -> copyloc:srcloc -> 'a with_loc -> 'a with_loc

module COPYLOCS: sig
type t
val none: t
val append: copyloc:srcloc -> string -> t -> t
val mem: string -> t -> bool
end

type leading_or_trailing = Leading | Trailing
[@@deriving show, ord]
val no_copy: copylocs
val new_copy: copyloc:srcloc -> string -> copylocs -> copylocs
val mem_copy: string -> copylocs -> bool
8 changes: 4 additions & 4 deletions src/lsp/cobol_lsp/lsp_document.ml
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ module TYPES = struct
project: Lsp_project.t;
textdoc: Lsp.Text_document.t;
copybook: bool;
pplog: Cobol_preproc.rev_log;
pplog: Cobol_preproc.log;
tokens: Cobol_parser.tokens_with_locs Lazy.t;
parsed: parsed_data option;
(* Used for caching, when loading a cache file as the file is not reparsed,
@@ -52,7 +52,7 @@ module TYPES = struct
doc_cache_checksum: Digest.t; (* checked against file on disk on reload *)
doc_cache_langid: string;
doc_cache_version: int;
doc_cache_pplog: Cobol_preproc.rev_log;
doc_cache_pplog: Cobol_preproc.log;
doc_cache_tokens: Cobol_parser.tokens_with_locs;
doc_cache_parsed: (PTREE.compilation_group * CUs.t) option;
doc_cache_diags: DIAGS.Set.serializable;
@@ -103,7 +103,7 @@ let lazy_references ast cus defs =
let analyze ({ project; textdoc; copybook; _ } as doc) =
let pplog, tokens, (parsed, diags) =
if copybook then
[], lazy [], (None, DIAGS.Set.none)
Cobol_preproc.Trace.empty, lazy [], (None, DIAGS.Set.none)
else
let ptree = parse ~project textdoc in
Cobol_parser.preproc_rev_log ptree,
@@ -129,7 +129,7 @@ let blank ~project ?copybook textdoc =
{
project;
textdoc;
pplog = [];
pplog = Cobol_preproc.Trace.empty;
tokens = lazy [];
diags = DIAGS.Set.none;
parsed = None;
48 changes: 24 additions & 24 deletions src/lsp/cobol_lsp/lsp_request.ml
Original file line number Diff line number Diff line change
@@ -233,36 +233,36 @@ let handle_semantic_tokens_full registry (params: SemanticTokensParams.t) =

let handle_hover registry (params: HoverParams.t) =
let filename = Lsp.Uri.to_path params.textDocument.uri in
let find_hovered_replacement pplog =
List.find_opt begin fun Cobol_preproc.{ matched_loc; _ } ->
Lsp_position.is_in_lexloc params.position
(Cobol_common.Srcloc.lexloc_in ~filename matched_loc)
end pplog
let find_hovered_pplog_event pplog =
List.find_opt begin function
| Cobol_preproc.Replacement { matched_loc = loc; _ }
| Cobol_preproc.FileCopy { copyloc = loc; _ } ->
Lsp_position.is_in_lexloc params.position
(Cobol_common.Srcloc.lexloc_in ~filename loc)
end (Cobol_preproc.Trace.events pplog)
in
let hover_markdown ~loc value =
let content = MarkupContent.create ~kind:MarkupKind.Markdown ~value in
let range = Lsp_position.range_of_srcloc_in ~filename loc in
Some (Hover.create () ~contents:(`MarkupContent content) ~range)
in
try_with_document_data registry params.textDocument
~f:begin fun ~project ~textdoc:_ ~pplog ~tokens:_ { ast; _ } ->
match Lsp_lookup.copy_at_pos ~filename params.position ast with
| Some { payload = lib; loc } ->
let text = EzFile.read_file lib in
(* TODO: grab source-format from preprocessor state? *)
let module Config = (val project.cobol_config) in
let mdlang = match Config.format#value with
| SF (SFFree | SFVariable | SFCOBOLX) -> "cobolfree"
| SF _ | Auto -> "cobol"
in
Pretty.string_to (hover_markdown ~loc) "```%s\n%s\n```" mdlang text
| None ->
match find_hovered_replacement pplog with
| None -> None
| Some Cobol_preproc.{ matched_loc = loc; replacement_text; _ } ->
Pretty.string_to (hover_markdown ~loc) "``@[<h>%a@]``"
Cobol_preproc.Text.pp_text replacement_text
end
let Lsp_document.{ project; pplog; _ } =
Lsp_server.find_document params.textDocument registry in
match find_hovered_pplog_event pplog with
| Some Replacement { matched_loc = loc; replacement_text; _ } ->
Pretty.string_to (hover_markdown ~loc) "``@[<h>%a@]``"
Cobol_preproc.Text.pp_text replacement_text
| Some FileCopy { copyloc = loc; status = CopyDone lib | CyclicCopy lib } ->
let text = EzFile.read_file lib in
(* TODO: grab source-format from preprocessor state? *)
let module Config = (val project.cobol_config) in
let mdlang = match Config.format#value with
| SF (SFFree | SFVariable | SFCOBOLX) -> "cobolfree"
| SF _ | Auto -> "cobol"
in
Pretty.string_to (hover_markdown ~loc) "```%s\n%s\n```" mdlang text
| Some FileCopy { status = MissingCopy _; _ } | None ->
None

let handle_completion registry (params:CompletionParams.t) =
let open Lsp_completion in
4 changes: 2 additions & 2 deletions src/lsp/cobol_parser/parser_engine.ml
Original file line number Diff line number Diff line change
@@ -446,8 +446,8 @@ module Make (Config: Cobol_config.T) = struct
Only res, all_diags ps
| Eidetic ->
let tokens = Tokzr.parsed_tokens ps.preproc.tokzr
and rev_log = Cobol_preproc.rev_log ps.preproc.pp in
WithTokens (res, tokens, rev_log), all_diags ps
and log = Cobol_preproc.log ps.preproc.pp in
WithTokens (res, tokens, log), all_diags ps

end

2 changes: 1 addition & 1 deletion src/lsp/cobol_parser/parser_engine.mli
Original file line number Diff line number Diff line change
@@ -30,4 +30,4 @@ val parse_with_tokens: Cobol_common.Behaviors.eidetic parsing_function
val parsed_tokens
: (_, Cobol_common.Behaviors.eidetic) parsed_result -> tokens_with_locs Lazy.t
val preproc_rev_log
: (_, Cobol_common.Behaviors.eidetic) parsed_result -> Cobol_preproc.rev_log
: (_, Cobol_common.Behaviors.eidetic) parsed_result -> Cobol_preproc.log
2 changes: 1 addition & 1 deletion src/lsp/cobol_parser/parser_options.ml
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ type tokens_with_locs = Grammar_tokens.token with_loc list
type ('a, 'm) output =
| Only: 'a ->
('a, Cobol_common.Behaviors.amnesic) output
| WithTokens: 'a * tokens_with_locs Lazy.t * Cobol_preproc.rev_log ->
| WithTokens: 'a * tokens_with_locs Lazy.t * Cobol_preproc.log ->
('a, Cobol_common.Behaviors.eidetic) output

type ('a, 'm) parsed_result =
2 changes: 2 additions & 0 deletions src/lsp/cobol_preproc/cobol_preproc.ml
Original file line number Diff line number Diff line change
@@ -18,5 +18,7 @@ module Text = Text
module Text_printer = Text_printer

module Copybook = Copybook
module Trace = Preproc_trace

include Trace.TYPES
include Preproc_engine
25 changes: 10 additions & 15 deletions src/lsp/cobol_preproc/preproc.ml
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ module DIAGS = Cobol_common.Diagnostics
(* --- *)

include Preproc_tokens (* include token type directly *)
include Preproc_trace (* include log events *)

(* --- *)

@@ -153,17 +154,11 @@ and replacing =
}
and partial_subst =
{
partial_subst_dir: Cobol_common.Srcloc.leading_or_trailing;
partial_subst_dir: replacing_direction;
partial_subst_len: int;
partial_subst_regexp: Str.regexp;
}

type log_entry =
{
matched_loc: srcloc;
replacement_text: text;
}
type log = log_entry list
and replacing_direction = Leading | Trailing

(* --- Implementation of replacing operations ------------------------------- *)

@@ -202,7 +197,7 @@ let partial_word (type k) (req: k partial_word_request) words : (k, _) result =

type partial_replacing =
{
repl_dir: Cobol_common.Srcloc.leading_or_trailing;
repl_dir: replacing_direction;
repl_strict: bool;
}

@@ -486,7 +481,7 @@ let try_replacing_clause: replacing with_loc -> text -> _ result = fun replacing
match pseudotext_exact_match ~&repl_from text with
| Ok (l, r, matched_loc, suffix) ->
let replacement_text = to_text ~replloc repl_to ~old:matched_loc in
let log_entry = { matched_loc; replacement_text } in
let log_entry = Replacement { matched_loc; replacement_text } in
Ok (delim l replacement_text r, log_entry, suffix)
| Error _ as e ->
e
@@ -495,10 +490,10 @@ let try_replacing_clause: replacing with_loc -> text -> _ result = fun replacing
begin fun text ->
match textword_partial_replace ~replloc repl_subst repl_to text with
| Ok ((t, matched_loc), suffix) when ~&t = "" ->
Ok ([], { matched_loc; replacement_text = [] }, suffix)
Ok ([], Replacement { matched_loc; replacement_text = [] }, suffix)
| Ok ((t, matched_loc), suffix) ->
let replacement_text = [lift_textword t] in
let log_entry = { matched_loc; replacement_text } in
let log_entry = Replacement { matched_loc; replacement_text } in
Ok (replacement_text, log_entry, suffix)
| Error _ as e ->
e
@@ -531,11 +526,11 @@ let apply_replacing k repl log =
fun k done_text log text ->
match k, try_replacing_phrase k repl text, text with
| OnPartText, Ok (done_text', le, []), _ ->
Ok (done_text @ done_text', le :: log)
Ok (done_text @ done_text', Preproc_trace.append le log)
| OnFullText, Ok (done_text', le, []), _ ->
done_text @ done_text', le :: log
done_text @ done_text', Preproc_trace.append le log
| _, Ok (done_text', le, text), _ ->
aux k (done_text @ done_text') (le :: log) text
aux k (done_text @ done_text') (Preproc_trace.append le log) text
| OnPartText, Error `MissingText, _ ->
Error (`MissingText (done_text, log, text))
| OnPartText, Error `NoReplacement, [] ->
18 changes: 7 additions & 11 deletions src/lsp/cobol_preproc/preproc.mli
Original file line number Diff line number Diff line change
@@ -54,20 +54,14 @@ and library =
and fileloc = [`Word | `Alphanum] * string
and replacing

type log_entry =
{
matched_loc: srcloc;
replacement_text: text;
}
type log = log_entry list

type (_, _) repl_attempt =
| OnPartText: ([`NoReplacement | `MissingText],
partial_text_repl_result) repl_attempt
| OnFullText: ([`NoReplacement],
text * log) repl_attempt
text * Preproc_trace.log) repl_attempt
and partial_text_repl_result =
(text * log, [`MissingText of text * log * text]) result
(text * Preproc_trace.log,
[`MissingText of text * Preproc_trace.log * text]) result

module type ENTRY_POINTS = sig
type 'x entry
@@ -90,9 +84,11 @@ end

type partial_replacing =
{
repl_dir: Cobol_common.Srcloc.leading_or_trailing;
repl_dir: replacing_direction;
repl_strict: bool;
}
and replacing_direction = Leading | Trailing

val replacing
: ?partial:partial_replacing
-> pseudotext with_loc
@@ -101,7 +97,7 @@ val replacing
val apply_replacing
: (_, 'a) repl_attempt
-> replacing with_loc list
-> log
-> Preproc_trace.log
-> text
-> 'a

55 changes: 25 additions & 30 deletions src/lsp/cobol_preproc/preproc_engine.ml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
(* *)
(**************************************************************************)

open Cobol_common.Srcloc
open Cobol_common.Srcloc.TYPES
open Cobol_common.Srcloc.INFIX
open Cobol_common.Diagnostics.TYPES

@@ -36,22 +36,12 @@ let decide_source_format _input

(* --- *)

type log = log_entry list
and rev_log = log
and log_entry = Preproc.log_entry =
{
matched_loc: Cobol_common.Srcloc.srcloc;
replacement_text: Text.text;
}

(* --- *)

type preprocessor =
{
buff: Text.text;
srclex: Preproc.any_srclexer;
ppstate: Preproc.state;
pplog: Preproc.log;
pplog: Preproc_trace.log;
diags: DIAGS.diagnostics;
persist: preprocessor_persist;
}
@@ -62,7 +52,7 @@ and preprocessor_persist =
overlay_manager: (module Src_overlay.MANAGER);
config: Cobol_config.t;
replacing: Preproc.replacing with_loc list list;
copybooks: COPYLOCS.t; (* opened copybooks *)
copybooks: Cobol_common.Srcloc.copylocs; (* opened copybooks *)
libpath: string list;
verbose: bool;
show_if_verbose: [`Txt | `Src] list;
@@ -72,19 +62,21 @@ let diags { diags; srclex; _ } =
DIAGS.Set.union diags @@ Preproc.srclex_diags srclex
let add_diag lp d = { lp with diags = DIAGS.Set.cons d lp.diags }
let add_diags lp d = { lp with diags = DIAGS.Set.union d lp.diags }
let log { pplog; _ } = List.rev pplog
let rev_log { pplog; _ } = pplog
let log { pplog; _ } = (* List.rev *) pplog
(* let rev_log { pplog; _ } = pplog *)
let srclexer { srclex; _ } = srclex
let position { srclex; _ } = Preproc.srclex_pos srclex

let with_srclex lp srclex =
if lp.srclex == srclex then lp else { lp with srclex }
let with_diags lp diags =
if lp.diags == diags then lp else { lp with diags }
(* let with_diags lp diags = *)
(* if lp.diags == diags then lp else { lp with diags } *)
let with_buff lp buff =
if lp.buff == buff then lp else { lp with buff }
let with_pplog lp pplog =
if lp.pplog == pplog then lp else { lp with pplog }
let with_diags_n_pplog lp diags pplog =
if lp.diags == diags && lp.pplog == pplog then lp else { lp with diags; pplog }
let with_buff_n_pplog lp buff pplog =
if lp.buff == buff && lp.pplog == pplog then lp else { lp with buff; pplog }
let with_replacing lp replacing =
@@ -121,15 +113,15 @@ let preprocessor ?(on_period_only = true) ?(verbose = false) input = function
buff = [];
srclex = make_srclex ~on_period_only ~source_format input;
ppstate = Preproc.initial_state;
pplog = [];
diags = diags;
pplog = Preproc_trace.empty;
diags;
persist =
{
pparser = (module Pp);
overlay_manager = (module Om);
config = (module Config);
replacing = [];
copybooks = COPYLOCS.none;
copybooks = Cobol_common.Srcloc.no_copy;
libpath;
verbose;
show_if_verbose = [`Src];
@@ -144,7 +136,8 @@ let preprocessor ?(on_period_only = true) ?(verbose = false) input = function
persist =
{
persist with
copybooks = COPYLOCS.append ~copyloc copybook persist.copybooks;
copybooks =
Cobol_common.Srcloc.new_copy ~copyloc copybook persist.copybooks;
verbose = persist.verbose || verbose;
};
}
@@ -306,28 +299,30 @@ and do_replace lp rev_prefix repl suffix =
`ReplaceDone (lp, prefix, suffix)


and read_lib ({ diags; persist = { libpath; copybooks; verbose; _ }; _ } as lp)
and read_lib ({ persist = { libpath; copybooks; verbose; _ }; _ } as lp)
loc { libname; cbkname } =
let libpath = match ~&?cbkname with None -> libpath | Some (_, d) -> [d] in
let text, diags = match Copybook.find_lib ~libpath ~&libname with
| Ok filename when COPYLOCS.mem filename copybooks ->
let text, diags, pplog = match Copybook.find_lib ~libpath ~&libname with
| Ok filename when Cobol_common.Srcloc.mem_copy filename copybooks ->
(* TODO: `note addendum *)
[],
DIAGS.Acc.error diags ~loc "@[Cyclic@ COPY@ of@ `%s'@]" filename
DIAGS.Acc.error lp.diags ~loc "@[Cyclic@ COPY@ of@ `%s'@]" filename,
Preproc_trace.cyclic_copy ~loc ~filename lp.pplog
| Ok filename ->
if verbose then
Pretty.error "Reading library `%s'@." filename;
let text, pp' =
full_text
let text, lp = (* note: [lp] holds all prev and new diags *)
full_text (* likewise for pplog *)
(preprocessor (Filename filename) (`Fork (lp, loc, filename)))
~postproc:(Cobol_common.Srcloc.copy_from ~filename ~copyloc:loc)
in
text, pp'.diags
text, lp.diags, Preproc_trace.copy_done ~loc ~filename lp.pplog
| Error lnf ->
[],
Copybook.lib_not_found_error (DIAGS.Acc.error diags ~loc "%t") lnf
Copybook.lib_not_found_error (DIAGS.Acc.error lp.diags ~loc "%t") lnf,
Preproc_trace.missing_copy ~loc ~info:lnf lp.pplog
in
text, with_diags lp diags
text, with_diags_n_pplog lp diags pplog

and full_text ?(item = "library") ?postproc lp : Text.text * preprocessor =
let eofp p = ~&p = Text.Eof in
11 changes: 1 addition & 10 deletions src/lsp/cobol_preproc/preproc_engine.mli
Original file line number Diff line number Diff line change
@@ -25,21 +25,12 @@ type init =
init_source_format: Cobol_config.source_format_spec;
}

type log = log_entry list
and rev_log = log
and log_entry = Preproc.log_entry =
{
matched_loc: Cobol_common.Srcloc.srcloc;
replacement_text: Text.text;
}

(* --- *)

val diags: preprocessor -> Cobol_common.Diagnostics.Set.t
val add_diag: preprocessor -> Cobol_common.Diagnostics.t -> preprocessor
val add_diags: preprocessor -> Cobol_common.Diagnostics.Set.t -> preprocessor
val log: preprocessor -> log
val rev_log: preprocessor -> rev_log
val log: preprocessor -> Preproc_trace.log
val srclexer: preprocessor -> Preproc.any_srclexer
val position: preprocessor -> Lexing.position
val next_sentence: preprocessor -> Text.text * preprocessor
6 changes: 3 additions & 3 deletions src/lsp/cobol_preproc/preproc_grammar.mly
Original file line number Diff line number Diff line change
@@ -133,9 +133,9 @@ let copy_replacing_text_identifier :=
and rpar = Text.pseudoword_of_string (")" &@<- _rpar) in
c @ [lpar] @ cl @ [rpar] }

let leading_or_trailing :=
| LEADING; { Cobol_common.Srcloc.Leading }
| TRAILING; { Cobol_common.Srcloc.Trailing }
let leading_or_trailing ==
| LEADING; { Preproc.Leading }
| TRAILING; { Preproc.Trailing }

(* --- REPLACE -------------------------------------------------------------- *)

51 changes: 51 additions & 0 deletions src/lsp/cobol_preproc/preproc_trace.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
(**************************************************************************)
(* *)
(* Copyright (c) 2021-2023 OCamlPro SAS *)
(* *)
(* All rights reserved. *)
(* This file is distributed under the terms of the *)
(* OCAMLPRO-NON-COMMERCIAL license. *)
(* *)
(**************************************************************************)

(** Some utilities to log preprocessing events. *)

open Cobol_common.Srcloc.TYPES

module TYPES = struct
type log_entry =
| FileCopy of
{
copyloc: srcloc;
status: copy_event_status;
}
| Replacement of
{
matched_loc: srcloc;
replacement_text: Text.text;
}

and copy_event_status =
| CopyDone of string
| CyclicCopy of string
| MissingCopy of Copybook.lib_not_found_info

type log = log_entry list
end
include TYPES

(* --- *)

let empty = []
let append =
List.cons
let copy_done ~loc ~filename : log -> log =
List.cons @@ FileCopy { copyloc = loc; status = CopyDone filename }
let cyclic_copy ~loc ~filename : log -> log =
List.cons @@ FileCopy { copyloc = loc; status = CyclicCopy filename }
let missing_copy ~loc ~info : log -> log =
List.cons @@ FileCopy { copyloc = loc; status = MissingCopy info }

(* --- *)

let events: log -> log_entry list = List.rev
56 changes: 56 additions & 0 deletions src/lsp/cobol_preproc/preproc_trace.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
(**************************************************************************)
(* *)
(* Copyright (c) 2021-2023 OCamlPro SAS *)
(* *)
(* All rights reserved. *)
(* This file is distributed under the terms of the *)
(* OCAMLPRO-NON-COMMERCIAL license. *)
(* *)
(**************************************************************************)

module TYPES: sig
type log_entry =
| FileCopy of
{
copyloc: Cobol_common.Srcloc.srcloc;
status: copy_event_status;
}
| Replacement of
{
matched_loc: Cobol_common.Srcloc.srcloc;
replacement_text: Text.text;
}

and copy_event_status =
| CopyDone of string
| CyclicCopy of string
| MissingCopy of Copybook.lib_not_found_info

type log
end

include module type of TYPES
with type copy_event_status = TYPES.copy_event_status
and type log_entry = TYPES.log_entry
and type log = TYPES.log

val empty: log
val append
: log_entry
-> log -> log
val copy_done
: loc: Cobol_common.srcloc
-> filename: string
-> log -> log
val cyclic_copy
: loc: Cobol_common.srcloc
-> filename: string
-> log -> log
val missing_copy
: loc: Cobol_common.srcloc
-> info: Copybook.lib_not_found_info
-> log -> log

(* --- *)

val events: log -> log_entry list
2 changes: 1 addition & 1 deletion src/lsp/cobol_preproc/preproc_utils.mli
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ open Cobol_common.Diagnostics.TYPES
module Make (Config: Cobol_config.T) : sig

val replacing'
: ?repl_dir:Cobol_common.Srcloc.leading_or_trailing
: ?repl_dir:Preproc.replacing_direction
-> [< `Alphanum of Text.pseudotext
| `PseudoText of Text.pseudotext ] Cobol_common.Srcloc.with_loc
-> Text.pseudotext Cobol_common.Srcloc.with_loc