jon.recoil.org

Module Merlin_kernel.MpipelineSource

Sourcetype t
Sourceval make : Mconfig.t -> Msource.t -> t
Sourceval make_with_parsetree : state:Mocaml.typer_state -> Mconfig.t -> Msource.t -> Mreader.parsetree -> t

Create a pipeline with a pre-provided parsetree, bypassing reader and ppx phases.

The parsetree is used directly for type checking. The source is still needed for position resolution (e.g., get_lexing_pos).

This is used for fast-path completion: the caller gets the ppx parsetree from a normal pipeline, strips uninteresting parts, then creates a new pipeline with the stripped parsetree for cheaper type checking.

The config should have a modified filename (e.g., append "__for_completion") to avoid cache collisions with the normal pipeline.

The state parameter allows reusing the typer state from an existing pipeline, which is necessary when called from within with_pipeline (where Local_store is already bound and creating a new state would fail). Use the state from the normal pipeline that provided the parsetree.

Sourceval with_pipeline : t -> (unit -> 'a) -> 'a
Sourceval for_completion : Msource.position -> t -> t
Sourceval raw_source : t -> Msource.t
Sourceval typer_state : t -> Mocaml.typer_state
Sourceval input_config : t -> Mconfig.t
Sourceval input_source : t -> Msource.t
Sourceval get_lexing_pos : t -> [< Msource.position ] -> Lexing.position
Sourceval reader_config : t -> Mconfig.t
Sourceval reader_comments : t -> (string * Ocaml_parsing.Location.t) list
Sourceval reader_parsetree : t -> Mreader.parsetree
Sourceval reader_lexer_keywords : t -> string list
Sourceval reader_lexer_errors : t -> exn list
Sourceval reader_parser_errors : t -> exn list
Sourceval reader_no_labels_for_completion : t -> bool
Sourceval ppx_parsetree : t -> Mreader.parsetree
Sourceval ppx_errors : t -> exn list
Sourceval final_config : t -> Mconfig.t
Sourceval typer_result : t -> Mtyper.result
Sourceval typer_errors : t -> exn list
Sourceval document_overrides : t -> string Overrides.t
Sourceval locate_overrides : t -> Lexing.position Overrides.t
Sourceval timing_information : t -> (string * float) list
Sourceval cache_information : t -> Merlin_utils.Std.json