File: merlin_helpers.mli

package info (click to toggle)
ppxlib 0.15.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 1,284 kB
  • sloc: ml: 17,184; sh: 149; makefile: 36; python: 36
file content (26 lines) | stat: -rw-r--r-- 899 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
(** Some helpers to annotate the AST so merlin can decide which branches to look at and
    which branches to ignore. *)

open! Import

(** {2 Annotations merlin understand} *)

(** Adding this [[@merlin.hide]] attribute on a piece of AST "hides" it from merlin: it
    tells merlin not to consider that branch if another piece of AST with the same
    location exist. *)
val hide_attribute  : attribute

(** Adding this [[@merlin.focus]] attribute on a piece of AST tells merlin to prefer it to
    any other piece of AST when several have the same location. *)
val focus_attribute : attribute

(** {2 Helpers}

    The following functions add the corresponding attribute (defined above) to specific
    pieces of AST. *)

val hide_pattern  : pattern -> pattern
val focus_pattern : pattern -> pattern

val hide_expression  : expression -> expression
val focus_expression : expression -> expression