giraud / reasonml-idea-plugin

ReasonML Language Plugin for IDEA
https://giraud.github.io/reasonml-idea-plugin/
MIT License
338 stars 22 forks source link

Ppx generated code is not indexed #164

Open Coobaha opened 5 years ago

Coobaha commented 5 years ago

plugin version: 0.75

Description

module Test = [%graphql {|
{
  user {
    name
  }
  allUsers {
    id
  }
}
 |}];

Test.<cursor> /* <--- Autocomplete is empty */

Actual interface is

module Test:
  {
    let ppx_printed_query: string;
    let query: string;
    let parse:
      Js.Json.t =>
      {. "allUsers": Js.Array.t({. "id": string}),
        "user": option({. "name": string})};
    let make:
      unit =>
      {. "parse": Js.Json.t =>
                  {. "allUsers": Js.Array.t({. "id": string}),
                    "user": option({. "name": string})},
        "query": string, "variables": Js.Json.t};
    let makeWithVariables:
      {. } =>
      {. "parse": Js.Json.t =>
                  {. "allUsers": Js.Array.t({. "id": string}),
                    "user": option({. "name": string})},
        "query": string, "variables": Js.Json.t};
    module type mt_ret = { type t; };
    type typed_ret('a) = (module mt_ret with type t = 'a);
    let ret_type: ('a => 'b) => typed_ret('b);
    module MT_Ret:
      {
        type t =
            {. "allUsers": Js.Array.t({. "id": string}),
              "user": option({. "name": string})};
      };
    type t = MT_Ret.t;
  };
Coobaha commented 5 years ago

Repo with graphql ppx setup https://github.com/Coobaha/reasonml-idea-plugin-graphql-ppx-issue