-
Notifications
You must be signed in to change notification settings - Fork 182
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
Line/region indentation feature (emacs integration) #1207
Conversation
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.
This would be a nice feature ! But the fact that you have to give it line numbers in the formatted output makes it unusable, I think.
How hard it is to fix that ?
I agree that we'll need something like this, but it's not super clear to me how much needs to be done in ocamlformat and how much will be done by the editor. Editor integration will be fairly large amount of work, and I think we need to step back a bit from the code and work out a spec first, and see what kind of features we'll need based on that. Then we'll be able to iterate on both. We don't want to ship a new option that will end up not being useful. |
91845d0
to
f64cf4d
Compare
521d3e0
to
971b725
Compare
6973351
to
9037a70
Compare
081bc88
to
e4c6998
Compare
For reference there is a PR on opam-user-setup to add ocamlformat: ocaml-opam/opam-user-setup#48 I'm not familiar with the way it works but I'm not sure there is an easy way to switch from ocp-indent to ocamlformat in this tool. I'm still digging but if someone has experience with this feel free to help :) |
abf0d2e
to
dd4f310
Compare
558d948
to
b284293
Compare
b3cc4cb
to
d213d63
Compare
3617ec0
to
a59e3c6
Compare
a59e3c6
to
76ffd29
Compare
76ffd29
to
64ce012
Compare
64ce012
to
33567ff
Compare
33567ff
to
08c8528
Compare
I've reused some code from #1188 to reduce the time overhead of this feature, but there is still too much overhead compared to the current reindent feature in emacs. |
Replaced by #1609 |
the workflow is:
dune build @install && dune install
(require 'ocamlformat)
to your .emacsDisclaimer: so far what it does is applying the indentation of the (virtually) formatted output to the unformatted input, so if you break a line like this you can observe cases like:
because once formatted it is formatted on a single line (indented to 0)