Superbol_projectmodule TYPES : sig ... endinclude module type of TYPES
with type rootdir = TYPES.rootdir
and type project = TYPES.project
and type rootdir_fallback_policy = TYPES.rootdir_fallback_policy
and type layout = TYPES.layouttype rootdir = TYPES.rootdirtype project = TYPES.project = {rootdir : rootdir;config : Superbol_project__.Project_config.TYPES.config;config_filename : string;}type layout = TYPES.layout = {project_config_filename : string;Name of the TOML file that is to be found at the root of each project's directory tree.
*)relative_work_dirname : string option;Relative name of a directory where the LSP should put its working files (caches, etc). No such storage is allowed when None.
rootdir_fallback_policy : rootdir_fallback_policy;Policy to determine the root directory of projects based on individual filenames.
*)}and rootdir_fallback_policy = TYPES.rootdir_fallback_policy = type t = projectval rootdir_at : dirname:string -> rootdirrootdir_at ~dirname initializes a project into an existing directory.
Raises Invalid_argument in case dirname is not the name of an existing directory.
rootdir_for ~filename ~layout locates the project directory for a given file name. This project directory is the closest parent directory of filename that contains a file with the name layout.project_config_filename.
When no such file is found, the behavior depends on the given fallback policy: if layout.rootdir_fallback_policy = Same_as_file_directory, the name of the directory that contains filename is chosen as root for the project; alternatively, if the fallback is Given_directory dirname, directory dirname is used instead.
val for_ :
platform:Cobol_common.Platform.TYPES.platform ->
rootdir:rootdir ->
layout:layout ->
t Cobol_common.Diagnostics.TYPES.with_diagsfor_ ~platform ~rootdir ~layout retrieves a project based on its root directory.
This may trigger reading project configuration files if the project was not yet loaded. The name of the project's configuration file is determined by the layout argument. The configuration files of its dialect are accessed through platform.
with_default_config ~rootdir ~layout initializes a project structure with a default configuration.
val copybook_lookup_config_for :
filename:string ->
t ->
Cobol_common.Copybook.TYPES.lookup_configcopybook_lookup_config_for ~uri project constructs a copybook lookup configuration for a source file with name filename, in the given project.
val detect_copybook :
platform:Cobol_common.Platform.TYPES.platform ->
filename:string ->
?contents:string ->
t ->
booldetect_copybook ~filename project indicates whether a document with the given filename should be treated as a copybook in project.
val decode_source :
?encoding:Cobol_common.Text_encoding.t ->
t ->
string ->
stringdecode_source ?encoding project contents decodes the contents of a source file of project read from disk, with encoding if given, or else with the source_encoding of its configuration (if any).
val of_cache :
platform:Cobol_common.Platform.TYPES.platform ->
rootdir:rootdir ->
layout:layout ->
cached ->
t Cobol_common.Diagnostics.TYPES.with_diagsof_cache ~rootdir ~layout cached_project attempts to load and return a cached project. Behaves like for_ ~rootdir ~layout in case of error (outdated or missing configuration file).
val config : t -> Superbol_project__.Project_config.TYPES.configval save_config : ?verbose:bool -> t -> unitval reload_config :
platform:Cobol_common.Platform.TYPES.platform ->
?verbose:bool ->
t ->
bool Cobol_common.Diagnostics.TYPES.with_diagsreload_config ~verbose project reloads the configuration of project from its associated TOML file. Returns true when the reloaded configuration does not match with the one before the call. Prints some informative message on stderr if verbose is set.
module SET : sig ... endval string_of_rootdir : rootdir -> stringval relative_path_for : filename:string -> t -> stringval absolute_path_for : filename:string -> t -> stringwork_dirname ~layout project is the directory where working files of project (caches, etc.) are put according to layout, if any. Walks through the sources of the project should skip it.
module Config : sig ... endmodule Layout : sig ... endmodule Diagnostics : sig ... endmodule Cache : sig ... endmodule Walk : sig ... endmodule Analysis : sig ... endAnalysis of individual documents, independently of any front-end.
module Cached_diagnostics : sig ... endDiagnostics of documents, cached on their own so that they can be reported for documents that are not open, without restoring their (much larger) analysis for the LSP.
module Semantic_tokens : sig ... endSemantic tokens of documents, cached apart from the analysis for the LSP they are computed from.
module Hardcoded_assumptions : sig ... endAssumptions about the target machine that are hard-coded for now, and could become configurable later.