merlin icon indicating copy to clipboard operation
merlin copied to clipboard

add test: show locate failing in presence of same name definition in record punning

Open ulugbekna opened this issue 2 years ago • 3 comments

ulugbekna avatar Mar 05 '22 15:03 ulugbekna

I feel like the current behaviour is actually correct:

When calling jump-to-definition at that (|) point:

module M = struct
  type t = { foo : int }
  
  let foo = 42
end

let foo = 43

let m = { M.fo|o }

~I do expect the cursor to jump to the definition of M.foo not the field foo in the type M.t.~

However the behaviour when jumping explicitely to the label is broken so I added a test to illustrate it.

voodoos avatar Mar 18 '22 14:03 voodoos

I do expect the cursor to jump to the definition of M.foo not the field foo in the type M.t.

Oh, I meant that the cursor should jump to let foo = 43 on line 7 because that will be the value of m.foo. Someone who wants to jump to the definition of foo in { M.foo } likely wants to understand what's going to be the value of the field foo in the new record being created. Wdyt?

ulugbekna avatar Mar 19 '22 11:03 ulugbekna

Yes that makes sense. I will update the test before merging.

voodoos avatar Mar 20 '22 01:03 voodoos