-
Notifications
You must be signed in to change notification settings - Fork 141
Add ocamlformat-mlx for .mlx files #1528
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
base: master
Are you sure you want to change the base?
Conversation
ocaml-lsp-server/src/document.ml
Outdated
(* TODO: Unsure about this, keeping it empty for now *) | ||
| Mlx -> | ||
(match kind with | ||
| Intf -> [ re; ml; mly; mll ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Intf -> [ re; ml; mly; mll ] | |
| Intf -> [ re; ml; mly; mll; mlx ] |
as we want to be able to switch to .mlx from .mli if it is present
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But here we are matching on an "Mlx Intf", which is not an mli
file, right ? I am not sure that case happens at all. But nothing really bad could happen from having too many of such rules...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at the surrounding code, I thought the kind
belongs to the origin, so we are on interface file and want to switch to the implementation, which can be .re, .ml, .mly, mll, and now .mlx
ocaml-lsp-server/src/document.ml
Outdated
in | ||
match Syntax.of_fname fname with | ||
| Dune | Cram -> [] | ||
(* TODO: Unsure about this, keeping it empty for now *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not clear what's the TODO about
@davesnx I am not familiar with ocamlformat-mlx, but overall this looks correct. However the CI is failing with a non-exhaustive pattern matching error, could you fix that ? |
Embarrassing, I would push this forward. Thanks for the review @voodoos. I wanted to test this PR manually before merging as well, is it as easy as pinning to ensure everything works or do I need something else? |
I would expect so, please report if it doesn't :-) |
…rmat-mlx * 'master' of github.com:/ocaml/ocaml-lsp: nix: updates (ocaml#1550) refactor: get rid of a bunch of [Stdune.String] uses (ocaml#1551) Deleted a dead link (ocaml#1549) Yojson 3 compat (ocaml#1534) Prepare release 1.23.0 (ocaml#1539) Delegate outline generation to Merlin (ocaml#1529) Fix yojson constraint (ocaml#1538) chore: remove all the stdune [O] references (ocaml#1483) Handle new kind of outline symbol (ocaml#1527)
ad4d4a8
to
0988f2b
Compare
Small PR to format mlx files with ocamlformat-mlx.
In mlx we encourage dune fmt via dune dialects, but the lsp runs those formatters outside of dune.