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

locate: use location coming from the environment for the local buffer only #984

Merged
merged 7 commits into from
Jun 26, 2019

Conversation

trefis
Copy link
Contributor

@trefis trefis commented Jun 26, 2019

For the longest time, locate has tried to avoid using locations coming from the environment, as they might not direct you to the right place. Indeed, they will always point you to the interface if there is one, whereas the user might have asked to be brought to the implementation.

So what was done is that the location was remembered, and use as a fallback if the "analysis" failed (because of limitations of the analysis, or because of bugs).
However, the fallback was a source of issues itself. Indeed, if there are several source files with the same name in your workspace, then the fallback generally gave you no indication regarding which one to jump to.

Because of that, I recently decided to never use locations coming from the environment as a fallback.
This put a fairly serious limitation of the current implementation into light: mutually recursive bindings are not handled properly (#973).

Given that #973 is a problem only in the local buffer, instead of trying to improve the analysis to handle that case properly, I decided to revert back to using locations coming from the environment, but only if these locations are in the local buffer (to track that I just mark every location coming from a cmi as ghost when loading them).

@let-def let-def self-requested a review June 26, 2019 13:27
Copy link
Contributor

@let-def let-def left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est merveilleux.

@trefis trefis merged commit 4b4c493 into master Jun 26, 2019
@trefis trefis deleted the locate-env-loc branch June 26, 2019 13:29
let-def pushed a commit to let-def/opam-repository that referenced this pull request Jul 9, 2019
CHANGES:

Tue Jul  9 17:34:42 CEST 2019

  + backend
    - `**` globbing in .merlin won't look into hidden directories
      (starting with a '.') (by Daniel Bünzl, ocaml/merlin#990)
    - fallback to "/dev/null" configuration for findlib
    - better 4.08 support:
      + support for letop (let+, and+, ...) (ocaml/merlin#986)
      + fix parsing recovery for 4.08 constructions (ocaml/merlin#987)
      + catch an exception raised by 4.08 Printtyp trying to rename a
        persistent identifier (ocaml/merlin#991)
    - locate: treat local locations differently from external locations (coming
      from a cmi), this fixes "jump to definition" on mutually recursive
      bindings (ocaml/merlin#984)
    - when completing an infix operator in a sub-module, wrap with () (ocaml/merlin#992)
  + editor modes
    - emacs
      + fix position computation in presence of tabs or multi-byte characters (ocaml/merlin#981)
      + log arguments in "merlin-debug-last-commands" (ocaml/merlin#981)
    - vim
      + install reason.vim file (by Hezekiah M. Carty, ocaml/merlin#974)
let-def pushed a commit to let-def/opam-repository that referenced this pull request Jul 15, 2019
CHANGES:

Mon Jul 15 11:10:35 CEST 2019

  + backend
    - `**` globbing in .merlin won't look into hidden directories
      (starting with a '.') (by Daniel Bünzl, ocaml/merlin#990)
    - fallback to "/dev/null" configuration for findlib
    - better 4.08 support:
      + support for letop (let+, and+, ...) (ocaml/merlin#986)
      + fix parsing recovery for 4.08 constructions (ocaml/merlin#987)
      + catch an exception raised by 4.08 Printtyp trying to rename a
        persistent identifier (ocaml/merlin#991)
    - locate: treat local locations differently from external locations (coming
      from a cmi), this fixes "jump to definition" on mutually recursive
      bindings (ocaml/merlin#984)
    - when completing an infix operator in a sub-module, wrap with () (ocaml/merlin#992)
    - disable arity checks on externals (for Bucklescript compatibility)
    - remove parser preprocessing (simplify compilation for OCaml < 4.08) (ocaml/merlin#997)
  + editor modes
    - emacs
      + fix position computation in presence of tabs or multi-byte characters (ocaml/merlin#981)
      + log arguments in "merlin-debug-last-commands" (ocaml/merlin#981)
    - vim
      + install reason.vim file (by Hezekiah M. Carty, ocaml/merlin#974)
let-def pushed a commit to let-def/opam-repository that referenced this pull request Jul 15, 2019
CHANGES:

Mon Jul 15 11:10:35 CEST 2019

  + backend
    - `**` globbing in .merlin won't look into hidden directories
      (starting with a '.') (by Daniel Bünzl, ocaml/merlin#990)
    - fallback to "/dev/null" configuration for findlib
    - better 4.08 support:
      + support for letop (let+, and+, ...) (ocaml/merlin#986)
      + fix parsing recovery for 4.08 constructions (ocaml/merlin#987)
      + catch an exception raised by 4.08 Printtyp trying to rename a
        persistent identifier (ocaml/merlin#991)
    - locate: treat local locations differently from external locations (coming
      from a cmi), this fixes "jump to definition" on mutually recursive
      bindings (ocaml/merlin#984)
    - when completing an infix operator in a sub-module, wrap with () (ocaml/merlin#992)
    - disable arity checks on externals (for Bucklescript compatibility)
    - remove parser preprocessing (simplify compilation for OCaml < 4.08) (ocaml/merlin#997)
  + editor modes
    - emacs
      + fix position computation in presence of tabs or multi-byte characters (ocaml/merlin#981)
      + log arguments in "merlin-debug-last-commands" (ocaml/merlin#981)
    - vim
      + install reason.vim file (by Hezekiah M. Carty, ocaml/merlin#974)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants