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

Binding operators in occurrence and locate #1405

Merged
merged 3 commits into from
Mar 29, 2022
Merged

Conversation

mattiase
Copy link
Contributor

Find binding operator uses in Occurrence and their definitions in Locate (issue #1398)
Although Locate works from a position where the binding operator syntax is used, Occurrence does not but requires the position to indicate the reified (bracketed) operator.

Copy link
Collaborator

@voodoos voodoos left a comment

Choose a reason for hiding this comment

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

Thank you for that contribution @mattiase !

Apart from a few small things it looks good to me.
There are still some issues with occurrences but it already improves the situation a lot.

Can you rebase and add a Changelog entry ?

This allows the Locate operation to recognise a binding
operator (`let*`, `and+` etc) at the given position.
CHANGES.md Outdated
@@ -10,6 +10,7 @@ git version
- handle `=` syntax in compiler flags (#1409)
- expose all destruct exceptions in the api (#1437)
- fix superfluous break in error reporting (#1432)
- recognise binding operators in locate and occurrences (#1398)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- recognise binding operators in locate and occurrences (#1398)
- recognise binding operators in locate and occurrences (#1398, @mattiase)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really fond of tooting my own horn but you make the rules; changing.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We usually credit external contributors, but don't feel obliged to do it if you prefer to remain in the shadows :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, but it's fine to keep it as it is.

Right now this only works when the the `-identifier-at` position
indicates a reified binding operator, not an actual use of the
operator syntax.
@voodoos
Copy link
Collaborator

voodoos commented Mar 28, 2022

Not sure why the CI broke (but it is most probably not related to this PR).
@smorimoto could that be related to the release of 4.14 ? But our CI config didn't change and ask for 4.13:

ocaml-version:
          - 4.13.0

The error is:

Install system packages required by opam packages
  /Users/runner/hostedtoolcache/opam/2.1.2/x86_64/opam depext dot-merlin-reader merlin
  # Detecting depexts using vars: arch=x86_64, os=macos, os-distribution=homebrew, os-family=homebrew
  [ERROR] No solution for dot-merlin-reader & merlin:   * No agreement on the version of ocaml-base-compiler:
              - (invariant) → ocaml-base-compiler >= 4.14.0
              - merlin → ocaml < 4.14 → ocaml-base-compiler = 3.07+2
              You can temporarily relax the switch invariant with `--update-invariant'
  
  
  'opam --cli=2.1 list --readonly --external --resolve=dot-merlin-reader,merlin' failed.
  Command failed: opam --cli=2.1 list --readonly --external '--resolve=dot-merlin-reader,merlin' returned 20
  Error: The process '/Users/runner/hostedtoolcache/opam/2.1.2/x86_64/opam' failed with exit code 20

Apparently OCaml 4.14 is installed even if our workflow file specify 4.13...

Install OCaml
  /Users/runner/hostedtoolcache/opam/2.1.2/x86_64/opam switch create . --no-install --packages ocaml-base-compiler.4.14.0

@smorimoto
Copy link
Member

I will raise a PR to fix that issue.

@voodoos voodoos merged commit 9d6ee9d into ocaml:master Mar 29, 2022
@mattiase mattiase deleted the bindop branch March 29, 2022 14:06
voodoos added a commit to voodoos/merlin that referenced this pull request Mar 29, 2022
Support for binding operators in occurrence and locate
voodoos added a commit to voodoos/merlin that referenced this pull request Mar 29, 2022
Support for binding operators in occurrence and locate
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.

3 participants