package merlin-lib

  1. Overview
  2. Docs
Merlin's libraries

Install

Dune Dependency

Authors

Maintainers

Sources

merlin-5.5-503.tbz
sha256=67da3b34f2fea07678267309f61da4a2c6f08298de0dc59655b8d30fd8269af1
sha512=1fb3b5180d36aa82b82a319e15b743b802b6888f0dc67645baafdb4e18dfc23a7b90064ec9bc42f7424061cf8cde7f8839178d8a8537bf4596759f3ff4891873

doc/src/merlin-lib.analysis/typed_hole.ml.html

Source file typed_hole.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
let syntax_repr = "_"
let can_be_hole s = String.equal syntax_repr s

(* the pattern matching below is taken and modified (minimally, to adapt the
   return type) from [Query_commands.dispatch]'s [Construct] branch;

   If we directly dispatched [Construct] command to merlin, we'd be doing
   useless computations: we need info whether the expression at the cursor is a
   hole, we don't need constructed expressions yet.

   Ideally, merlin should return a callback [option], which is [Some] when the
   context is applicable. *)
let is_a_hole = function
  | (_, Browse_raw.Module_expr { mod_desc = Tmod_typed_hole; _ }) :: (_, _) :: _
  | (_, Browse_raw.Expression { exp_desc = Texp_typed_hole; _ }) :: _ -> true
  | [] | (_, _) :: _ -> false
;;
OCaml

Innovation. Community. Security.