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

Support topiary as a formatter #1206

Open
toastal opened this issue Oct 27, 2023 · 5 comments
Open

Support topiary as a formatter #1206

toastal opened this issue Oct 27, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@toastal
Copy link

toastal commented Oct 27, 2023

I have been using topiary to for formatting instead of ocamlformat because topiary can support tabs like OCaml the language can support tabs. I’m getting an error on startup

LSP[ocamllsp][Info] Unable to find 'ocamlformat-rpc' binary. Types on hover may not be well-formatted. You need to install either 'ocamlformat' of version > 0.21.0 or, otherwise, 'ocamlformat-rpc' package.

But I’m not planning to use ocamlformat since it doesn’t meet my accessibility needs.

@rgrinberg
Copy link
Member

From what I understand, topiary supports many programming language. Would it make sense for topiary to have its own lsp server just for formatting? It seems rather inefficient to support topiary in every single LSP server out there.

@toastal
Copy link
Author

toastal commented Oct 30, 2023

Isn’t ocamlformat an independent formatter being supported here tho?

@jfeser jfeser added the enhancement New feature or request label Nov 7, 2023
@rgrinberg
Copy link
Member

It is, but it's OCaml only so we might as well support it in the only LSP server for OCaml. Topiary is much more flexible on the other hand.

@voodoos
Copy link
Collaborator

voodoos commented May 23, 2024

I have been using topiary to for formatting instead of ocamlformat because topiary can support tabs like OCaml the language can support tabs. I’m getting an error on startup

LSP[ocamllsp][Info] Unable to find 'ocamlformat-rpc' binary. Types on hover may not be well-formatted. You need to install either 'ocamlformat' of version > 0.21.0 or, otherwise, 'ocamlformat-rpc' package.

But I’m not planning to use ocamlformat since it doesn’t meet my accessibility needs.

Note that the message is not about using ocamlformat to actually format your code.
It is about using ocamlformat-rpc to format the types when you perform an hover.

You can install this package to get rid of the message, without starting using ocamlformat. Or is the formatting of the displayed types the thing that is non-accessible to you ?

In any case, users who choose not to use it should have a way to dismiss the popup permanently.

@toastal
Copy link
Author

toastal commented May 23, 2024

Ah. That makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants