Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jul 7, 2023

Conversation

ulugbekna
Copy link
Contributor

No description provided.

@voodoos
Copy link
Collaborator

voodoos commented Mar 18, 2022

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.

@ulugbekna
Copy link
Contributor Author

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?

@voodoos
Copy link
Collaborator

voodoos commented Mar 20, 2022

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

in presence of a shadowing definition
@voodoos voodoos added the no changelog Turn off CI changelog-check label Jul 4, 2023
@voodoos voodoos merged commit be47f1f into ocaml:master Jul 7, 2023
voodoos added a commit to voodoos/merlin that referenced this pull request Aug 24, 2023
…record punning (ocaml#1440)

from ulugbekna/record-pun-locate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Turn off CI changelog-check
Projects
Status: 4.10-500
Development

Successfully merging this pull request may close these issues.

2 participants