From: "Ulysse Gérard" <ulysse@u31.fr>
To: Kenichi Asai <asai@is.ocha.ac.jp>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] automatically resolving open?
Date: Thu, 24 Apr 2025 15:44:01 +0200 [thread overview]
Message-ID: <196507C2-30A8-403E-B04F-438FB789AB28@u31.fr> (raw)
In-Reply-To: <aAo3bjb7mjuqxM7b@pllab.is.ocha.ac.jp>
> On 24 Apr 2025, at 15:06, Kenichi Asai <asai@is.ocha.ac.jp> wrote:
>
> Thank you all for the information. I realize the problem is much
> harder than I first thought. But the refactor open of Merlin appears
> to be the closest to what I wanted. I confirmed that I can add and
> remove module names in emacs and VS Code. Can I do the same thing
> using a stand-alone command line tool? If not, can I do it from the
> VS Code extension programatically?
You can try to query manually to Merlin directly from the command line. For that you will still need to build your project so that the configuration is available. Then you will want to run something like this:
> ocamlmerlin single refactor-open -action qualify -position 4:6 -filename path/to/file.ml <path/to/file.ml
(note that you need to input the file content on stdin or the call will hang)
And then parse the output...
The commands are documented here: https://github.com/ocaml/merlin/blob/main/doc/dev/PROTOCOL.md
You can find examples in the test suite: https://github.com/ocaml/merlin/tree/main/tests/test-dirs/refactor-open
>
>> It appears to be working in only one direction however: from the
>> `open` statement it is possible to qualifying all identifiers coming
>> from that statement.
>
> In my environment, I could do both direction.
That's good to know !
prev parent reply other threads:[~2025-04-24 13:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-23 14:10 Kenichi Asai
2025-04-23 14:32 ` Francois Pottier
2025-04-23 14:38 ` BOBOT François
2025-04-23 14:45 ` Ivan Gotovchits
2025-04-23 15:33 ` Jeremy Yallop
2025-04-24 4:33 ` Oleg
2025-04-24 6:39 ` Virgile Prevosto
2025-04-24 9:16 ` Ulysse Gérard
2025-04-24 13:06 ` Kenichi Asai
2025-04-24 13:44 ` Ulysse Gérard [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=196507C2-30A8-403E-B04F-438FB789AB28@u31.fr \
--to=ulysse@u31.fr \
--cc=asai@is.ocha.ac.jp \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox