coq / vscoq

Visual Studio Code extension for Coq
MIT License
343 stars 69 forks source link

Misparsed tactic leads to two commands being exeucted at once #895

Open RalfJung opened 2 months ago

RalfJung commented 2 months ago

To reproduce, consider:

Lemma L (P Q R: Prop) :
  (P -> Q -> R) -> P -> Q -> R.
Proof.
  intros Himpl HP HQ. (* Process proof until here *)
  speciaalize (Himpl HP HQ) as Goo.

Qed.

Now hit Alt-down. I would expect vscoq to try to process the next tactic, which has a typo in it and therefore doesn't parse. However, processing actually skips all the way to after the Qed and I get two errors:

image

That is quite confusing. Worse, the Coq proof state window only shows the second error, making the actual underlying cause of the problem invisible: image

I can see it thanks to the error-lens addon, but if one does not have that installed, one has to notice the error in the "problems" panel.

The fact that according to the last screenshot, L got declared is concerning, since there can't even have been a complete proof.

This is with Coq 8.18.0.

rtetley commented 2 months ago

This is a duplicate of #877. I am busy working on a fix ! I will keep open because of the L is declared thing. This is probably related to the separation of interp and synterp phases.