package lsp

All checked builds pass
  1. Overview
  2. Docs

doc/src/lsp/code_action.ml.html

Source file code_action.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
open Import
open Types

let kind_to_string kind =
  match CodeActionKind.yojson_of_t kind with
  | `String kind -> kind
  | _ -> assert false
;;

let kind_is_requested only kind =
  match only with
  | None -> true
  | Some only ->
    let kind = kind_to_string kind in
    List.exists only ~f:(fun requested ->
      let requested = kind_to_string requested in
      String.equal requested kind || String.is_prefix kind ~prefix:(requested ^ "."))
;;