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

[Shapes] OCaml 4.14 + Shapes #1431

Merged
merged 18 commits into from
Apr 5, 2022
Merged

[Shapes] OCaml 4.14 + Shapes #1431

merged 18 commits into from
Apr 5, 2022

Conversation

voodoos
Copy link
Collaborator

@voodoos voodoos commented Jan 14, 2022

Another Pr for early testing.

  • Based on Upgrade Merlin to OCaml 4.14 #1415, an up-to-date upgrade to OCaml 4.14

  • With the latest version of @gasche's strong call-by-need PR

  • With the locate code that uses shapes similar to others recent testing PRs

  • Most tests are improved, one is not (jumping to declaration instead of a functor argument).

  • Documentation tests are not passing at all yet.

  • Add tests illustrating module aliases issue

  • [ ] fix by patching the compiler

  • fix documentation and dot-pp-dot-ml-dune tests

The corresponding compiler (4.14 + @gasche's cbn) to be used with this merlin can be found here:
https://github.com/voodoos/ocaml/tree/shape-strong-call-by-need

Sorry, something went wrong.

@voodoos voodoos changed the base branch from master to 414 January 14, 2022 14:59
@voodoos voodoos force-pushed the 414-shapes-cbn branch 3 times, most recently from 245a140 to 111f2b9 Compare January 27, 2022 14:28
@voodoos
Copy link
Collaborator Author

voodoos commented Jan 27, 2022

@trefis all tests are now passing, and jumping to the argument of a functor works again. This PR is ready for review !

To restore that behaviour I had to store the functor arguments uid in the uid_to_loc table of the local environment. See c5e6d07.
I suppose it is not necessary to upstream this as it only occurs in local buffers. But we might want to to reduce the divergence between Merlin and the compiler... What do you think ?

@voodoos
Copy link
Collaborator Author

voodoos commented Feb 3, 2022

@trefis : this now use uids to answer document queries when the target is in another comp_unit. It fallsback on the old heuristic when the target is in the current buffer or the previous algorithm found nothing (necessary for test unattached-comment).

I also reverted the changes for functor arguments. We now jump to the correct place in the argument's signature.

@voodoos
Copy link
Collaborator Author

voodoos commented Feb 4, 2022

I rebased both the 414 branch and this PR.
This led to the discovery of an issue with module aliases.
I will add more tests to illustrate the issue.

@voodoos
Copy link
Collaborator Author

voodoos commented Feb 10, 2022

@trefis all test fixed. This is ready for review. My original intent was to merge this into the 4.14 update PR but maybe we can first merge the update PR onto master and this one second ?

@voodoos voodoos changed the title [Shapes] OCaml 4.14 + Shapes + Strong call by need [Shapes] OCaml 4.14 + Shapes Mar 29, 2022
@voodoos voodoos mentioned this pull request Mar 29, 2022
@trefis trefis deleted the branch ocaml:master April 5, 2022 10:20
@trefis trefis closed this Apr 5, 2022
@trefis trefis reopened this Apr 5, 2022
@trefis trefis changed the base branch from 414 to master April 5, 2022 11:16
@voodoos voodoos force-pushed the 414-shapes-cbn branch 3 times, most recently from cb0a952 to 7d06a27 Compare April 5, 2022 16:35
voodoos and others added 16 commits April 5, 2022 13:37
Fix locate for documentation queries

Previously the locate function would relies on a Typedtrie search and ocasionally return the documentation at the same time. With shape-based locate this is not the case anymore and we always rely on a call to `Ocamldoc.associate_comment`.

This commit also fix file_switching log and simplifies locate's return type.

Split locate and from_longident code in two steps

- first identify the correct Uid by reducing the shape
- then load the cmt to find the corresponding location
fmt: remove some trailing whitespaces
This is necessary to share the code with the new uid-based get_doc function
@voodoos voodoos force-pushed the 414-shapes-cbn branch 3 times, most recently from d16dc0d to 5f9ff06 Compare April 5, 2022 18:08
voodoos and others added 2 commits April 5, 2022 15:34
Tests: OK (jump to functor arg sig)

Test: document OK

Test: update partial test

Test: add a new test foir predefs

Add test for jumping to a functor's argument

Test: show issue with dune's module aliases

Tests: module-doc foxed and improved

Tests: module-aliases fixed and improved

Tests: missing changes for module-aliases

Tests: Add failing test for completion doc

Tests: from-completion-query fixed + more cases

Remove the `partial-cmt` test

(The feature is not avalable anymorewith the shape-based backend.)
@voodoos voodoos merged commit 03563cd into ocaml:master Apr 5, 2022
voodoos added a commit to voodoos/opam-repository that referenced this pull request Apr 5, 2022
CHANGES for 414:

Tue Apr  5 20:51:42 CEST 2022

  + merlin binary
    - don't reset the environment when running merlin in single mode so that the
      parent environement is forwarded the the child processes (ocaml/merlin#1425)
    - filter dups in source paths (ocaml/merlin#1218)
    - improve load path performance (ocaml/merlin#1323)
    - fix handlink of ppx's under Windows (ocaml/merlin#1413)
    - locate: look for original source files before looking for preprocessed
      files (ocaml/merlin#1219 by @ddickstein, fixes ocaml/merlin#894)
    - handle `=` syntax in compiler flags (ocaml/merlin#1409)
    - expose all destruct exceptions in the api (ocaml/merlin#1437)
    - fix superfluous break in error reporting (ocaml/merlin#1432)
    - recognise binding operators in locate and occurrences (ocaml/merlin#1398, @mattiase)
    - remove dependency on Result (ocaml/merlin#1441, @kit-ty-kate)
    - use the new "shapes" generated by the compiler to perform precise
      jump-to-definition (ocaml/merlin#1431)
  + editor modes
    - fix an issue in Neovim where the current line jumps to the top of the
      window on repeated calls to `MerlinTypeOf` (ocaml/merlin#1433 by @ddickstein, fixes
      ocaml/merlin#1221)
    - add module, module type, and class imenu items for emacs (ocaml/merlin#1244, @ivg)
    - add prefix argument to force or prevent opening in a new buffer in locate
      command (ocaml/merlin#1426, @panglesd)
    - add type-on-hover functionality for vim (ocaml/merlin#1439, @nilsbecker)
    - add a dedicated buffer `*merlin-errors*` containing the last viewed error
      (ocaml/merlin#1414, @panglesd)
  + test suite
    - make `merlin-wrapper` create a default `.merlin` file  only when there is
      no `dune-project` to let tests use `dune ocaml-merlin` reader. (ocaml/merlin#1425)
    - cover locate calls on module aliases with and without dune
    - Add a test expliciting the interaction between locate and Dune's generated
      source files (ocaml/merlin#1444)

CHANGES for 413:

Tue Apr  5 20:59:42 CEST 2022

  + merlin binary
    - don't reset the environment when running merlin in single mode so that the
      parent environement is forwarded the the child processes (ocaml/merlin#1425)
    - filter dups in source paths (ocaml/merlin#1218)
    - improve load path performance (ocaml/merlin#1323)
    - fix handlink of ppx's under Windows (ocaml/merlin#1413)
    - locate: look for original source files before looking for preprocessed
      files (ocaml/merlin#1219 by @ddickstein, fixes ocaml/merlin#894)
    - handle `=` syntax in compiler flags (ocaml/merlin#1409)
    - expose all destruct exceptions in the api (ocaml/merlin#1437)
    - fix superfluous break in error reporting (ocaml/merlin#1432)
    - recognise binding operators in locate and occurrences (ocaml/merlin#1398, @mattiase)
    - remove dependency on Result (ocaml/merlin#1441, @kit-ty-kate)
  + editor modes
    - fix an issue in Neovim where the current line jumps to the top of the
      window on repeated calls to `MerlinTypeOf` (ocaml/merlin#1433 by @ddickstein, fixes
      ocaml/merlin#1221)
    - add module, module type, and class imenu items for emacs (ocaml/merlin#1244, @ivg)
    - add prefix argument to force or prevent opening in a new buffer in locate
      command (ocaml/merlin#1426, @panglesd)
    - add type-on-hover functionality for vim (ocaml/merlin#1439, @nilsbecker)
    - add a dedicated buffer `*merlin-errors*` containing the last viewed error
      (ocaml/merlin#1414, @panglesd)
  + test suite
    - make `merlin-wrapper` create a default `.merlin` file  only when there is
      no `dune-project` to let tests use `dune ocaml-merlin` reader. (ocaml/merlin#1425)
    - cover locate calls on module aliases with and without dune
    - Add a test expliciting the interaction between locate and Dune's generated
      source files (ocaml/merlin#1444)

CHANGES for 412:

Tue Apr  5 21:12:42 CEST 2022

  + merlin binary
    - don't reset the environment when running merlin in single mode so that the
      parent environement is forwarded the the child processes (ocaml/merlin#1425)
    - locate: look for original source files before looking for preprocessed
      files (ocaml/merlin#1219 by @ddickstein, fixes ocaml/merlin#894)
    - fix handlink of ppx's under Windows (ocaml/merlin#1413)
    - handle `=` syntax in compiler flags (ocaml/merlin#1409)
    - fix superfluous break in error reporting (ocaml/merlin#1432)
    - recognise binding operators in locate and occurrences (ocaml/merlin#1398, @mattiase)
    - improve load path performance (ocaml/merlin#1323)
    - remove dependency on Result (ocaml/merlin#1441, @kit-ty-kate)
  + editor modes
    - fix an issue in Neovim where the current line jumps to the top of the
      window on repeated calls to `MerlinTypeOf` (ocaml/merlin#1433 by @ddickstein, fixes
      ocaml/merlin#1221)
    - add module, module type, and class imenu items for emacs (ocaml/merlin#1244, @ivg)
    - add prefix argument to force or prevent opening in a new buffer in locate
      command (ocaml/merlin#1426, @panglesd)
    - add type-on-hover functionality for vim (ocaml/merlin#1439, @nilsbecker)
    - add a dedicated buffer `*merlin-errors*` containing the last viewed error
      (ocaml/merlin#1414, @panglesd)
  + test suite
    - make `merlin-wrapper` create a default `.merlin` file  only when there is
      no `dune-project` to let tests use `dune ocaml-merlin` reader. (ocaml/merlin#1425)

CHANGES for 411:

Tue Apr 5 21:17:21 PM CET 2022

  + merlin binary
    - don't reset the environment when running merlin in single mode so that the
      parent environement is forwarded the the child processes (ocaml/merlin#1425)
    - locate: look for original source files before looking for preprocessed
      files (ocaml/merlin#1219 by @ddickstein, fixes ocaml/merlin#894)
    - fix handling of ppx's under Windows (ocaml/merlin#1413)
    - handle `=` syntax in compiler flags (ocaml/merlin#1409)
    - fix superfluous break in error reporting (ocaml/merlin#1432)
    - recognise binding operators in locate and occurrences (ocaml/merlin#1398, @mattiase)
    - remove dependency on Result (ocaml/merlin#1441, @kit-ty-kate)
  + editor modes
    - update quick setup instructions for emacs (ocaml/merlin#1380, @ScriptDevil)
    - fix an issue in Neovim where the current line jumps to the top of the
      window on repeated calls to `MerlinTypeOf` (ocaml/merlin#1433 by @ddickstein, fixes
      ocaml/merlin#1221)
    - add module, module type, and class imenu items for emacs (ocaml/merlin#1244, @ivg)
    - add prefix argument to force or prevent opening in a new buffer in locate
      command (ocaml/merlin#1426, @panglesd)
    - add type-on-hover functionality for vim (ocaml/merlin#1439, @nilsbecker)
    - add a dedicated buffer `*merlin-errors*` containing the last viewed error
      (ocaml/merlin#1414, @panglesd)
  + test suite
    - make `merlin-wrapper` create a default `.merlin` file  only when there is
      no `dune-project` to let tests use `dune ocaml-merlin` reader. (ocaml/merlin#1425)
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.

None yet

2 participants