reasonml-editor / vscode-reasonml

OCaml & Reason support for Visual Studio Code
Apache License 2.0
491 stars 62 forks source link

Wrong module for "go to definition" #280

Open fotonmoton opened 5 years ago

fotonmoton commented 5 years ago

Go to definition sends to the wrong line in module.

To reproduce:

  1. Open .ml file with external modules in use
  2. Ctrl + click on functor/function/etc

Expected behavior: Editor opens right module with highlighted definition that was previously selected

Actual behavior: Editor opens wrong module and points to wrong line

image image

Env: OCaml: The OCaml toplevel, version 4.08.0 Dune: 1.10.0 Merlin: 3.3.1

Repo for reproduction.

fotonmoton commented 5 years ago

Can reproduce only for definitions in first part of code in test repo, before open Base.

fotonmoton commented 5 years ago

Actually "go to definition" on functions from Base.Map sends editor to standard Stdlib.Map functions.

image image

fotonmoton commented 5 years ago

Sorry, I saw Xavier Leroy, project Cristal and think it was map.ml from standard library. When I try to "go to definition" editor always jumps to map.ml from Base package, that's why when I select definitions above open Base in test repo I get wrong lines and definitions after works fine.

So, I think, open Base somehow confuses Merlin/VScode plugin and definitions with same names but from different modules point to same place.

image