merlin icon indicating copy to clipboard operation
merlin copied to clipboard

Support verbosity=smart

Open ulugbekna opened this issue 4 years ago • 8 comments

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

ulugbekna avatar Jul 27 '21 15:07 ulugbekna

Can I jump on the current reviews train? :D

ulugbekna avatar Nov 17 '21 13:11 ulugbekna

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 avatar Nov 22 '21 10:11 voodoos

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

Unfortunately not, but it should be

cc @rgrinberg

ulugbekna avatar Nov 22 '21 11:11 ulugbekna

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.

rgrinberg avatar Nov 22 '21 13:11 rgrinberg

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 avatar Nov 22 '21 15:11 voodoos

Indeed that’s the goal.

On Mon, 22 Nov 2021 at 16:01, Ulysse @.***> wrote:

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ocaml/merlin/pull/1374#issuecomment-975615630, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD4YR67EBXTVWZFEV2AQ6BTUNJLM7ANCNFSM5BCN65QA .

ulugbekna avatar Nov 22 '21 15:11 ulugbekna

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

voodoos avatar Nov 30 '21 17:11 voodoos

I hope to do so this week :-)

On Tue, 30 Nov 2021 at 18:38, Ulysse @.***> wrote:

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ocaml/merlin/pull/1374#issuecomment-982865623, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD4YR65C5JWZECTOXMPLRULUOUD2NANCNFSM5BCN65QA .

ulugbekna avatar Nov 30 '21 18:11 ulugbekna

Thanks for a prompt review! Addressed all comments

ulugbekna avatar Nov 14 '22 10:11 ulugbekna

We also need to update the protocol documentation: https://github.com/ocaml/merlin/blob/master/doc/dev/PROTOCOL.md#type-enclosing--position-position---expression-string----cursor-int----index-int-

voodoos avatar Nov 15 '22 09:11 voodoos

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

ulugbekna avatar Nov 16 '22 12:11 ulugbekna

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

🧐 looks like a great opportunity to do it 😅

voodoos avatar Nov 16 '22 12:11 voodoos

In another PR perhaps?

ulugbekna avatar Nov 16 '22 12:11 ulugbekna