Question about your approach: what happens if the code is syntactically invalid? Dark prevents code from being syntactically invalid cause it's AST only, but for example ocamlformat just refuses to run if it can't parse the whole file.
Question about your approach: what happens if the code is syntactically invalid? Dark prevents code from being syntactically invalid cause it's AST only, but for example ocamlformat just refuses to run if it can't parse the whole file.
In the future I plan to move over to the Merlin parser, which has partial support for syntactically invalid buffers (I believe it wraps invalid regions with another syntactic construct), so it should still be possible to move around in other parts of the buffer.
As an aside, as I mentioned on the OCaml forum, I haven’t found this to be a major issue as I find that most of the time when I’m moving around (i.e not inserting text), the code is usually syntactically correct - I’ve also bound M-RET to insert a type hole (??) to easily allow movement even when I haven’t completed a function definition, and overall this leads to quite a natural editing experience.