Skip to content

Format ocaml blocks with ocamlformat-rpc#316

Closed
gpetiot wants to merge 5 commits intorealworldocaml:mainfrom
gpetiot:ocamlformat-rpc
Closed

Format ocaml blocks with ocamlformat-rpc#316
gpetiot wants to merge 5 commits intorealworldocaml:mainfrom
gpetiot:ocamlformat-rpc

Conversation

@gpetiot
Copy link
Copy Markdown
Contributor

@gpetiot gpetiot commented Feb 4, 2021

@gpetiot
Copy link
Copy Markdown
Contributor Author

gpetiot commented Mar 3, 2021

I've added an option --format-code to enable this feature.

@emillon @NathanReb @jsomers @pitag-ha I was having a look at how we can pass an instance of a running ocamlformat-rpc server to mdx (instead of spawning the process in mdx like it's currently the case) but didn't find any solution. At first I thought the pid of the process would be enough but there is no way to get the right channels from the pid. What would be the right way to do it? I had a look at the dune rpc feature but it wasn't very helpful either

@gpetiot gpetiot requested review from NathanReb and pitag-ha March 16, 2021 14:07
@voodoos voodoos mentioned this pull request Mar 16, 2021
2 tasks
@gpetiot gpetiot marked this pull request as ready for review April 2, 2021 12:06
@gpetiot
Copy link
Copy Markdown
Contributor Author

gpetiot commented Apr 12, 2021

Ready to be reviewed!

@samoht
Copy link
Copy Markdown
Collaborator

samoht commented Apr 12, 2021

What would be the right way to do it? I had a look at the dune rpc feature but it wasn't very helpful either

Could you use a unix domain socket with a know name? e.g. /var/run/ocamlformat.sock or something similar? Or maybe embed the version number in the filename to have one socket per ocamlformat version.

@NathanReb
Copy link
Copy Markdown
Contributor

Could you use a unix domain socket with a know name? e.g. /var/run/ocamlformat.sock or something similar? Or maybe embed the version number in the filename to have one socket per ocamlformat version.

That does sound like a good idea!

@gpetiot gpetiot added the Help wanted 🔥 Extra attention is needed label Apr 21, 2021
@gpetiot
Copy link
Copy Markdown
Contributor Author

gpetiot commented Apr 22, 2021

cc @emillon to get some insight on the dune side, I'm afraid ocamlformat-rpc needs another release to support sockets (or maybe just having a in_channel/out_channel is enough to support sockets)

@gpetiot gpetiot removed the Help wanted 🔥 Extra attention is needed label Jun 21, 2021
@NathanReb NathanReb changed the base branch from master to main July 2, 2021 09:44
@gpetiot gpetiot marked this pull request as draft July 5, 2021 17:09
@gpetiot
Copy link
Copy Markdown
Contributor Author

gpetiot commented Sep 1, 2021

Replaced by #335

@gpetiot gpetiot closed this Sep 1, 2021
@gpetiot gpetiot deleted the ocamlformat-rpc branch September 1, 2021 11:34
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