terrateamio / ocaml-ts-mode

Ocaml mode for emacs using treesitter
MIT License
10 stars 1 forks source link

Using the `tuareg-mode` indentation engine #1

Closed KaranAhlawat closed 3 months ago

KaranAhlawat commented 3 months ago

So tuareg-mode already has quite a good indentation engine built into it. I realised from looking at python-ts-mode that we can use other indentation methods than using the treesitter indentation rules. Given this fact, do you think it would be a good idea to add a dependency on tuareg package, and use it's indentation engine in ocaml-ts-mode? Or maybe this mode can also be merged into tuareg itself, if needed. This saves us the effort of having to write and debug all the indentation rules necessary, as the work is already done in tuareg.

PS: I have this setup working locally on my installation of Emacs, and have not run into any issues so far.

KaranAhlawat commented 3 months ago

Pinging @orbitz since it has been a while since the repository saw any activity (sorry if that was unnecessary)

orbitz commented 3 months ago

@KaranAhlawat I'd love to have this as an option. Does it require a code change or is it just configuration? Either way a pull request to (optionally) support it OR a pull request documenting how to configure it would be greatly appreciated.

KaranAhlawat commented 3 months ago

Hi, I can make a PR for it. The only thing I'm unsure about is how we would add tuareg as a transitive dependency so that when ocaml-ts-mode is installed, tuareg is also installed

orbitz commented 3 months ago

Thanks, again, @KaranAhlawat