Issue #22 resolved

CamlP4 compiled path name provides strange location information

repo owner created an issue
module X = struct
  let x = 1

let _ = X.x

Ctrl+; and Ctrl+t at X.x work fine with ocamlc anywhere the cursor is on X.x.

But, if the code is compiled with camlp4o,

  • Ctrl+; only works when the cursor is on x
  • Ctrl+t only works when the cursor is on X.

Sigh... P4 sucks.

Comments (4)

  1. camlspotter reporter

    To record the type, we use e.exp_loc, but to record the use of identifier, we use Texp_ident (, {loc}, ).

    And this loc is smaller when parsed by p4. Workaround is to use loc but e.exp_loc instead.

    The workaround is in ecae9be1704e

  2. Log in to comment