Module Cobol_lsp.Project_cache

val save : params:Cobol_lsp__.Lsp_types.params -> Cobol_lsp__.Lsp_document.TYPES.document Stdlib__Map.Make(Lsp.Uri).t -> unit

save ~config docs saves the caches of all the given document's projects.

For any project p of which at least one document belongs to docs, any document of p that does not belong to docs is removed from p's cache.

Some notifications about the saving process may be pushed via Lsp_io.send_notification. May raise some IO-related exceptions (Sys_error, Failure).

val load : rootdir:Superbol_project.rootdir -> layout:Superbol_project.layout -> params:Cobol_lsp__.Lsp_types.params -> Superbol_project__.Project.TYPES.project option

load ~rootdir ~config ~layout pre-loads cached documents pertaining to a project located in rootdir, with project directory layout layout.

All projects in the returned map belong to the same project. Note this map may actually be empty (for instance in case of missing, out-dated cache files, or cache files for a different version of the library).

Some notifications about the loading process may be pushed via Lsp_io.send_notification. May raise some IO-related exceptions (Sys_error, Failure).

Saving a single document

val save_document : params:Cobol_lsp__.Lsp_types.params -> Cobol_lsp__.Lsp_document.TYPES.document -> unit

save_document ~params doc persists the cache of doc alone, and records it in the cache of its project so that a later session finds it again. The other documents of that project are left as they are.

Used when a document is saved by the editor: that is when what the file holds and what was parsed are known to agree, which is the condition for a cached document to be of any use.

Some notifications about the saving process may be pushed via Lsp_io.send_notification.

Loading a single document

val load_document : project:Superbol_project__.Project.TYPES.project -> params:Cobol_lsp__.Lsp_types.params -> doc:Lsp.Types.DidOpenTextDocumentParams.t -> Cobol_lsp__.Lsp_document.TYPES.document option

load_document ~project ~params ~doc attempts to restore the document doc that the client has just opened, from the cache of project. Returns None whenever its analysis is missing from the cache, or out-dated.

The analysis may have been stored by another front-end.