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

wip: compatibility with merlin-lib 5.1-502 #1233

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

voodoos
Copy link
Collaborator

@voodoos voodoos commented Feb 23, 2024

Preliminary support for the 414-5.2~preview version of merlin-lib for ocaml 5.2.

@jfeser the changes in the representation of functions breaks the beta-reduction feature of the action-inline code action. It would be great if you could find some time to restore it before the final release (sometime in April I think).

@jfeser
Copy link
Collaborator

jfeser commented Feb 27, 2024

Dumb question, but how do I get the right version of merlin for building this PR? I've been using nix and I'm not very familiar with the opam pinning workflow.

@voodoos
Copy link
Collaborator Author

voodoos commented Feb 28, 2024

I cannot help you with the nix setup, but there is a preview version of Merlin released on opam that should work with that pr: 4.14-502~preview

@jfeser
Copy link
Collaborator

jfeser commented May 3, 2024

I've pushed some commits here: https://github.com/jfeser/ocaml-lsp/tree/merlin-update. The new version of beta reduction is more correct but less aggressive. It only reduces fully applied functions and does not attempt to reduce functions with labeled parameters.

@voodoos
Copy link
Collaborator Author

voodoos commented May 6, 2024

Thanks for taking the time @jfeser !
I will cherry-pick these commits to the update's branch.

.ocamlformat Outdated Show resolved Hide resolved
@rgrinberg
Copy link
Member

Dumb question, but how do I get the right version of merlin for building this PR? I've been using nix and I'm not very familiar with the opam pinning workflow.

I've added a flake input for merlin here #1264. So you can just set the branch/tag/commit in the flake.nix and then run nix develop.

@voodoos
Copy link
Collaborator Author

voodoos commented May 22, 2024

@rgrinberg what are your plans for 5.2 support ? (Merlin 5.0-502 with which that PR is compatible was just released.)

With the non-trivial typedtree changes in 5.2, the update breaks the multi-version support we managed to kept for some time.
Additionally, we cannot get any of the CI running without bumping ocamlformat since they all try to install it...

Should we aim at merging this PR (there is some work to do on the CI still) and then cut a release ?
Or do you prefer that I open a branch for 5.2 and release from that branch ?

let _ =
let f : int -> int = fun x -> x in
(0) |}]
[%expect {| |}]
Copy link
Member

Choose a reason for hiding this comment

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

What happened in this test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cc @jfeser

It looks like this does not fit the description you made of the "less agressive" beta reduction:

The new version of beta reduction is more correct but less aggressive. It only reduces fully applied functions and does not attempt to reduce functions with labeled parameters.

Copy link
Member

Choose a reason for hiding this comment

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

Okay, let's leave a comment about why this is broken and move on. 5.1 support is more important than this corner case.

Copy link
Member

Choose a reason for hiding this comment

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

Give me a chance to fix the nix compatibility before you merge though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Give me a chance to fix the nix compatibility before you merge though.

We have a working nix flake on merlin that might be of help: https://github.com/ocaml/merlin/blob/master/flake.nix

@rgrinberg
Copy link
Member

My plan was to wait for @awilliambauer to finish submitting his series of patches and make a release. So that we can achieve the following two goals:

  1. Release all the new features to users of 4.14 and 5.1
  2. Sync the fork of ocamllsp and upstream

Once that is done, we'd no longer need to care about preserving 5.1 (and below) compatibility in the master branch

@awilliambauer
Copy link
Contributor

Just a heads up there will be some delay getting the rest of the patches submitted. It will be a little while before I have more time to look into the issue with #1290. We also have a patch to add more inlay hint configuration that involves changes to typedtree stuff that is different upstream, and it will take some work to port and test that.

@rgrinberg
Copy link
Member

rgrinberg commented May 28, 2024 via email

@voodoos voodoos changed the title wip: compatibility with merlin-lib 414-5.2~preview wip: compatibility with merlin-lib 5.1-502 Jun 10, 2024
@voodoos
Copy link
Collaborator Author

voodoos commented Jun 10, 2024

@rgrinberg there is no ppx_expect.common library since 0.17.0 I updated the dune files in 2aee922.

@voodoos voodoos force-pushed the 5.2-preview branch 2 times, most recently from a644bff to e9ed7d2 Compare June 11, 2024 08:42
@rgrinberg
Copy link
Member

@rgrinberg there is no ppx_expect.common library since 0.17.0 I updated the dune files in 2aee922.

Can this be done in a separate PR?

@voodoos
Copy link
Collaborator Author

voodoos commented Jun 11, 2024

Can this be done in a separate PR?

Will do.

About the release plan, what I have in mind right now is:

@rgrinberg rgrinberg force-pushed the 5.2-preview branch 2 times, most recently from ce036f2 to 3ac8ec6 Compare June 14, 2024 02:14
voodoos and others added 15 commits June 13, 2024 23:17
Use merlin-lib config types and utilities

Bump  merlin-lib and ocaml-format versions
Note: function applications will only be eliminated when they are fully applied
and none of the arguments are labeled.
_
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
_
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
_
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
_
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
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

5 participants