Skip to content

Support verbosity=smart#1374

Merged
voodoos merged 9 commits intoocaml:masterfrom
ulugbekna:verbosity-smart
Nov 17, 2022
Merged

Support verbosity=smart#1374
voodoos merged 9 commits intoocaml:masterfrom
ulugbekna:verbosity-smart

Conversation

@ulugbekna
Copy link
Copy Markdown
Contributor

@ulugbekna ulugbekna commented Jul 27, 2021

What the PR does

Implements support for verbosity=smart.

Note: I tried to keep changes for adding verbosity=smart minimal.

Includes a couple of clean ups, I can remove them from this PR if necessary.

Also includes a fix for: The format for MERLIN_LOG env var is different in two places in merlin new_merlin.ml and ocamlmerlin_server.ml -- MERLIN_LOG= filename{,section}* or filename

Note: I noticed that a part of functions in Type_utils use the global mutable verbosity as a way to avoid passing verbosity as an argument along the call hierarchy, another half - passed verbosity around. I could perhaps fix this if there is clear preference. It also seems slightly more involved change than this one.

Reviewing

It is best to go commit-by-commit.


In the end, it looks quite good on the ocaml-lsp's side:

image

if not exact then raise Exit;
let verbosity = !Type_utils.verbosity in
let verbosity =
Mconfig.Verbosity.to_int !Type_utils.verbosity ~for_smart:1
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In most cases, I tried to keep in mind ocaml-lsp's use case for verbosity=smart, but I'm not sure what to put here.

@ulugbekna
Copy link
Copy Markdown
Contributor Author

Can I jump on the current reviews train? :D

@voodoos
Copy link
Copy Markdown
Collaborator

voodoos commented Nov 22, 2021

Can I jump on the current reviews train? :D

Sorry, it will have to be after the imminent release.

I am curious: is that already in-use in OCaml-lsp ?

@voodoos voodoos added this to the 4.5 / 3.8 milestone Nov 22, 2021
@ulugbekna
Copy link
Copy Markdown
Contributor Author

ulugbekna commented Nov 22, 2021

I am curious: is that already in-use in OCaml-lsp ?

Unfortunately not, but it should be

cc @rgrinberg

@rgrinberg
Copy link
Copy Markdown
Member

We can experiment with this patch in lsp first if you'd like, but it needs to be a lot smaller. For starters, get rid of all nonessential changes to ease the maintenance.

@voodoos
Copy link
Copy Markdown
Collaborator

voodoos commented Nov 22, 2021

Our priority right now is the release but I can have a look shortly after if the goal is to have it upstreamed to not rely on another ocaml-lsp side's patch.

@voodoos voodoos self-requested a review November 22, 2021 15:09
@ulugbekna
Copy link
Copy Markdown
Contributor Author

ulugbekna commented Nov 22, 2021 via email

@voodoos
Copy link
Copy Markdown
Collaborator

voodoos commented Nov 30, 2021

@ulugbekna could you move the clean-ups/refactoring parts of the PR to another one as you suggested ?

@ulugbekna
Copy link
Copy Markdown
Contributor Author

ulugbekna commented Nov 30, 2021 via email

@voodoos voodoos mentioned this pull request Nov 7, 2022
@voodoos voodoos added this to the 4.7 / 3.9 milestone Nov 14, 2022
Copy link
Copy Markdown
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.

Thanks a lot @ulugbekna the changes mostly look good to me :-)

@ulugbekna
Copy link
Copy Markdown
Contributor Author

Thanks for a prompt review! Addressed all comments

@voodoos
Copy link
Copy Markdown
Collaborator

voodoos commented Nov 15, 2022

@ulugbekna
Copy link
Copy Markdown
Contributor Author

but that document doesn't mention -verbosity at all?

@voodoos
Copy link
Copy Markdown
Collaborator

voodoos commented Nov 16, 2022

but that document doesn't mention -verbosity at all?

🧐 looks like a great opportunity to do it 😅

@ulugbekna
Copy link
Copy Markdown
Contributor Author

In another PR perhaps?

…which more clearly states what the function does
ulugbekna and others added 8 commits November 17, 2022 15:18
Co-authored-by: Ulysse <5031221+voodoos@users.noreply.github.com>
Co-authored-by: Ulysse <5031221+voodoos@users.noreply.github.com>
Co-authored-by: Ulysse <5031221+voodoos@users.noreply.github.com>
@voodoos voodoos merged commit a6a53d6 into ocaml:master Nov 17, 2022
voodoos added a commit to voodoos/opam-repository that referenced this pull request Nov 24, 2022
CHANGES:

Thu Nov 24 13:31:42 CEST 2022

  + merlin binary
    - Replace custom "holes" AST nodes by extensions. This restores binary
      compatibility and fixes issues with PPXs when using typed-holes.
      (ocaml/merlin#1503)
    - Do not change temporarily Merlin's cwd when starting a PPX (ocaml/merlin#1521,
      fixes ocaml/merlin#1420)
    - Fix a parsing issue when declaring the `(??)` custom prefix operator.
      (ocaml/merlin#1507, fixes ocaml/merlin#1506)
    - Fix variant constructors' comments grouping (ocaml/merlin#1516, @mheiber, fixes ocaml/merlin#1513)
    - Filter-out duplicates from the `enclosing` command result (ocaml/merlin#1512)
    - Add a new `verbosity=smart` mode for type enclosing that only expand
      modules' types (ocaml/merlin#1374, @ulugbekna)
    - Improve locate for labels' declarations in the current buffer.
      (ocaml/merlin#1505, fixes ocaml/merlin#1524)
    - Fix locate on module without implementation (ocaml/merlin#1522, fixes ocaml/merlin#1519)
    - Allow program name customization when merlin is used as a library. (ocaml/merlin#1532)
  + editor modes
    - vim: load the plugin when necessary if it wasn't loaded before (ocaml/merlin#1511)
    - emacs: update CI for newer releases and fix some warnings (ocaml/merlin#1454,
      @mattiase)
  + test suite
    - Add tests for constructors' documentation (ocaml/merlin#1511)
    - Add test cases for label comment documentation (ocaml/merlin#1526, @mheiber)
    - Add a test for the `enclosing` command (ocaml/merlin#1512)
    - Add tests for interactions between locate and record labels (ocaml/merlin#1505)
    - Add test showing an issue with locate and implicit transitive deps
voodoos added a commit to voodoos/opam-repository that referenced this pull request Nov 24, 2022
CHANGES:

  + merlin binary
    - Replace custom "holes" AST nodes by extensions. This restores binary
      compatibility and fixes issues with PPXs when using typed-holes.
      (ocaml/merlin#1503)
    - Do not change temporarily Merlin's cwd when starting a PPX (ocaml/merlin#1521,
      fixes ocaml/merlin#1420)
    - Fix a parsing issue when declaring the `(??)` custom prefix operator.
      (ocaml/merlin#1507, fixes ocaml/merlin#1506)
    - Fix variant constructors' comments grouping (ocaml/merlin#1516, @mheiber, fixes ocaml/merlin#1513)
    - Filter-out duplicates from the `enclosing` command result (ocaml/merlin#1512)
    - Add a new `verbosity=smart` mode for type enclosing that only expand
      modules' types (ocaml/merlin#1374, @ulugbekna)
    - Improve locate for labels' declarations in the current buffer.
      (ocaml/merlin#1505, fixes ocaml/merlin#1524)
    - Fix locate on module without implementation (ocaml/merlin#1522, fixes ocaml/merlin#1519)
    - Allow program name customization when merlin is used as a library. (ocaml/merlin#1532)
  + editor modes
    - vim: load the plugin when necessary if it wasn't loaded before (ocaml/merlin#1511)
    - emacs: update CI for newer releases and fix some warnings (ocaml/merlin#1454,
      @mattiase)
  + test suite
    - Add tests for constructors' documentation (ocaml/merlin#1511)
    - Add test cases for label comment documentation (ocaml/merlin#1526, @mheiber)
    - Add a test for the `enclosing` command (ocaml/merlin#1512)
    - Add tests for interactions between locate and record labels (ocaml/merlin#1505)
    - Add test showing an issue with locate and implicit transitive deps

[new release] merlin (4.7-413)

CHANGES:

  + merlin binary
    - Replace custom "holes" AST nodes by extensions. This restores binary
      compatibility and fixes issues with PPXs when using typed-holes.
      (ocaml/merlin#1503)
    - Fix a parsing issue when declaring the `(??)` custom prefix operator.
      (ocaml/merlin#1507, fixes ocaml/merlin#1506)
    - Fix variant constructors' comments grouping (ocaml/merlin#1516, @mheiber, fixes ocaml/merlin#1513)
    - Filter-out duplicates from the `enclosing` command result (ocaml/merlin#1512)
  + editor modes
    - vim: load the plugin when necessary if it wasn't loaded before (ocaml/merlin#1511)
  + test suite
    - Add tests for constructors' documentation (ocaml/merlin#1511)
    - Add test cases for label comments documentation (ocaml/merlin#1526, @mheiber)
    - Add a test for the `enclosing` command (ocaml/merlin#1512)

[new release] merlin (4.7-412)

CHANGES:

  + merlin binary
    - Replace custom "holes" AST nodes by extensions. This restores binary
      compatibility and fixes issues with PPXs when using typed-holes.
      (ocaml/merlin#1503)
    - Fix a parsing issue when declaring the `(??)` custom prefix operator.
      (ocaml/merlin#1507, fixes ocaml/merlin#1506)
    - Fix variant constructors' comments grouping (ocaml/merlin#1516, @mheiber, fixes ocaml/merlin#1513)
    - Filter-out duplicates from the `enclosing` command result (ocaml/merlin#1512)
  + editor modes
    - vim: load the plugin when necessary if it wasn't loaded before (ocaml/merlin#1511)
  + test suite
    - Add tests for constructors' documentation (ocaml/merlin#1511)
    - Add test cases for label comment documentation (ocaml/merlin#1526, @mheiber)
    - Add a test for the `enclosing` command (ocaml/merlin#1512)
voodoos added a commit to voodoos/opam-repository that referenced this pull request Nov 24, 2022
CHANGES:

Thu Nov 24 17:49:42 CEST 2022

  + merlin binary
    - Replace custom "holes" AST nodes by extensions. This restores binary
      compatibility and fixes issues with PPXs when using typed-holes.
      (ocaml/merlin#1503)
    - Do not change temporarily Merlin's cwd when starting a PPX (ocaml/merlin#1521,
      fixes ocaml/merlin#1420)
    - Fix a parsing issue when declaring the `(??)` custom prefix operator.
      (ocaml/merlin#1507, fixes ocaml/merlin#1506)
    - Fix variant constructors' comments grouping (ocaml/merlin#1516, @mheiber, fixes ocaml/merlin#1513)
    - Filter-out duplicates from the `enclosing` command result (ocaml/merlin#1512)
    - Add a new `verbosity=smart` mode for type enclosing that only expand
      modules' types (ocaml/merlin#1374, @ulugbekna)
    - Improve locate for labels' declarations in the current buffer.
      (ocaml/merlin#1505, fixes ocaml/merlin#1524)
    - Fix locate on module without implementation (ocaml/merlin#1522, fixes ocaml/merlin#1519)
    - Allow program name customization when merlin is used as a library. (ocaml/merlin#1532)
  + editor modes
    - vim: load the plugin when necessary if it wasn't loaded before (ocaml/merlin#1511)
    - emacs: update CI for newer releases and fix some warnings (ocaml/merlin#1454,
      @mattiase)
  + test suite
    - Add tests for constructors' documentation (ocaml/merlin#1511)
    - Add test cases for label comment documentation (ocaml/merlin#1526, @mheiber)
    - Add a test for the `enclosing` command (ocaml/merlin#1512)
    - Add tests for interactions between locate and record labels (ocaml/merlin#1505)
    - Add test showing an issue with locate and implicit transitive deps
voodoos added a commit to voodoos/opam-repository that referenced this pull request Nov 24, 2022
CHANGES:

  + merlin binary
    - Replace custom "holes" AST nodes by extensions. This restores binary
      compatibility and fixes issues with PPXs when using typed-holes.
      (ocaml/merlin#1503)
    - Do not change temporarily Merlin's cwd when starting a PPX (ocaml/merlin#1521,
      fixes ocaml/merlin#1420)
    - Fix a parsing issue when declaring the `(??)` custom prefix operator.
      (ocaml/merlin#1507, fixes ocaml/merlin#1506)
    - Fix variant constructors' comments grouping (ocaml/merlin#1516, @mheiber, fixes ocaml/merlin#1513)
    - Filter-out duplicates from the `enclosing` command result (ocaml/merlin#1512)
    - Add a new `verbosity=smart` mode for type enclosing that only expand
      modules' types (ocaml/merlin#1374, @ulugbekna)
    - Improve locate for labels' declarations in the current buffer.
      (ocaml/merlin#1505, fixes ocaml/merlin#1524)
    - Fix locate on module without implementation (ocaml/merlin#1522, fixes ocaml/merlin#1519)
    - Allow program name customization when merlin is used as a library. (ocaml/merlin#1532)
  + editor modes
    - vim: load the plugin when necessary if it wasn't loaded before (ocaml/merlin#1511)
    - emacs: update CI for newer releases and fix some warnings (ocaml/merlin#1454,
      @mattiase)
  + test suite
    - Add tests for constructors' documentation (ocaml/merlin#1511)
    - Add test cases for label comment documentation (ocaml/merlin#1526, @mheiber)
    - Add a test for the `enclosing` command (ocaml/merlin#1512)
    - Add tests for interactions between locate and record labels (ocaml/merlin#1505)
    - Add test showing an issue with locate and implicit transitive deps
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