Closed daveyarwood closed 1 year ago
Possibly the same issue as #82
This is intentional, though somewhat awkward behavior. See #106 and here.
My understanding of that article is that the issue is expected, and also prevented in parinfer.js. So maybe the issue is that that same prevention needs to also be implemented in parinfer-rust? Or am I misunderstanding the issue?
Parinfer doesn't (and can't!) prevent putting a quote in a comment. In fact, if you put two quotes in a comment, parinfer works again. The "prevention" is that parinfer will not reformat code until the dangerous quote is resolved.
Parinfer-rust actually gives a good error. It's likely not being displayed by the editor integration:
ᐅ printf ';"\n' |parinfer-rust
parinfer-rust: Quotes must balanced inside comment blocks.
I stumbled upon this by chance and it actually made me think that there was some Neovim breaking change that broke parinfer. It turns out to be what appears to be a corner case bug in parinfer.
I was able to come up with this simple repro.
Steps to reproduce
Create a new Clojure file containing this:
Try doing ordinary parinfer things. For example, delete the
[
before"list of things"
and it correctly turns into this:Now, add a
"
character into the comment, like this:Try doing ordinary parinfer things.
Expected behavior
Same as described above. Deleting the
[
before"list of things"
should produce:Actual behavior
The unmatched double quote seems to completely break parinfer.
Deleting the
[
before"list of things"
incorrectly produces:(note the extra unmatched
]
that should have been removed automatically)