Skip to content

Editor analysis mishandles declarations read from signatures #9324

Closed

Description

@cknitt

Editor analysis handles declarations read from signatures (module types, signature constraints, .resi files) in several wrong ways.

// Sig.res
module type MT = {
  let inMt: int
}
module Impl: MT = {
  let inMt = 2
}
let a = Impl.inMt

module type WithSig = {
  module type S = {
    let sigValue: int
  }
  module Nested: S
}
module Sealed: WithSig = {
  module type S = {
    let sigValue: int
  }
  module Nested = {
    let sigValue = 1
  }
}
let sv = Sealed.Nested.sigValue

module M: {
  module Inner: {
    let v: int
  }
} = {
  module Inner = {
    let v = 1
  }
}

let i = Intf.x

// SigUse.res
let v = Sig.M.Inner.v

// Intf.res
let x = 1

// Intf.resi
let x: int
  1. Rename replaces the whole item: renaming inMt in module type MT replaces all of let inMt: int (1:2–1:15) with the new name. It also leaves let inMt = 2 in Impl unchanged. The result does not compile.
  2. Module types nested in a module type are not registered: Find References on Sealed.Nested.sigValue returns null.
  3. Nested modules of a constrained module: Find References on v in M's signature returns the whole item let v: int as the declaration's range, and misses the use Sig.M.Inner.v in SigUse.res.
  4. Interface values are listed twice: Find References on Intf.x lists Intf.resi 0:4 twice, and rename edits that range twice. The analysis fixtures Cross and References show the same duplicate.

Found while reviewing #9084.

Activity

  1. added theissue type on Nov 18, 2026
  2. added 9 commits that reference this issue on Nov 19, 2026
    b6796a8
    8ac0a09
    39c4de9
    7955ee9
    db7c37a
    3192a35
    d5a1470
    e6e856e
    fe98bb0
  3. added a commit that references this issue on Nov 19, 2026
    3a3ea2a
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