Closed lephe closed 1 year ago
I was able to reproduce this right away. For me, it happens 100% of the time with
It seems that CoqTextChangeListener.is_applicable
is called after step (1), and then never again. It returns False because the file is not a Coq file at that time. Then, the plugin cannot respond to text change events.
I don't have a fix in mind yet.
I've thought about it and I have two possible fixes in mind.
CoqTextChangeListener
run on every buffer. This should be very cheap, but it is philosophically unsatisfying.CoqTextChangeListener
by hand. They can be manually attached and detached from buffers. Done right, this would let us bypass any weirdness about is_applicable
and know for sure that there is a CoqTextChangeListener
attached to every buffer that has a background worker.I'm not a fan of the mess that option 2 creates, but it is the one I'm leaning toward.
Quick remark: shouldn't a ViewEventListener
be able to detect a change in syntax settings and then instantiate/attach a listener on the associated buffer if the syntax was set to Coq but no listener was present?
I've pushed a simple fix for now and filed a bug report upstream. We can come back to this if "listening to every change on every buffer" proves too costly.
In some cases, mostly after getting a Coq error after trying to step a statement, editing stepped code will not move the water mark back up.
Steps to reproduce :
About id
(which succeeds), then step the definition foridT
(which fails becauseid
only works at Type 0).About id2
.It doesn't happen all the time... I tried to debug it by changing the logger to print to the console, and it went away. I'm suspecting maybe some async/delay issues?
(I'm back at it and may have a PR or two coming, hopefully that helps!)