Skip to content

Rename in a .resi functor signature replaces the whole let line #9507

Backlog

Description

@cknitt

Renaming a value declared in a functor signature in a .resi replaces the whole let line instead of the name, and the file no longer parses.

// Fn.res
module type Ord = {
  type t
}
module MakeSet = (O: Ord) => {
  let add = (x: O.t) => [x]
}

// Fn.resi
module type Ord = {
  type t
}
module MakeSet: (O: Ord) =>
{
  let add: O.t => array<O.t>
}

Rename add to plus in Fn.resi. In Fn.res the edit covers only add, which is right. In Fn.resi it covers all of let add: O.t => array<O.t> (line 6, columns 3–28), so the line becomes plus.

Find References shows the same cause: it reports the .resi declaration at 6:3, the start of let, instead of 6:7, the start of add.

Outside a functor signature this works. For module Plain: { let add: int } the .resi declaration is reported at the name.

Seen on master 0a686a9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions