-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #781 PG does not position to error. #782
Conversation
This needs a bit of a test and discussion. It seems to work but it is difficult to be sure. Things to check that I can think of.
|
I just added a test that checks that the correct region is highlighted. Note: testing this I found something strange in error location info from coq |
51fe3b0
to
a86edc9
Compare
This is not ready yet. I will try to fix this by the end of the summer. |
Hi @Matafou, thanks a lot for working on this!
OK, I wouldn't have foreseen that fixing #781 would be that involved. But anyway, if it works in practice and we can get a good CI tests coverage, that'll already be pretty good!
I saw you used
Good question; this needs some discussion I guess, since your PR mainly touches coq.el, but also proof-shell.el. Anyway, we don't have a CI testsuite for other provers (I had opened this issue: #505 but it stalled).
I believe this is testable, and actually you already tested it IIUC:
there was no sentence after your comment's colon ↑
Does this mean that this PG PR will only work for Coq ≥ 8.20 ? in this case, should we revert #774 for Coq ≤ 8.19 ? I believe the start-of-term will be dense for you as well @Matafou, but let me know (Cc @hendriktews) if you have a free slot in the upcoming days and would like to video-meet to discuss this, I'll try to join. |
The two failing tests are on coq-8.11. I will try to investigate but maybe this is not blocking. |
48b0afc
to
6b4fbdc
Compare
This seems ready. I will merge this tomorrow if no one objects. |
0c6589b
to
61f8ab6
Compare
This PR
|
Tests is also added to check the exact position of the error highlighting. Description of the fix. We cannot use the " ^^^ " thing to compute the error location because commands are not stripped of newlines anymore (ProofGeneral#774). Solution: use the character position information given in the error message with the following subtleties: - position are given by coq **bytes** positions. - position given by coq is the position from the previous "." fed to coq. I.e. we must be careful to strip any blank after the final "." of a command. - Coq < 8.11 has a small glitch on positions, the test is compatible with both behaviour. - coq <= 8.20 has a bug on position for curly braces. In the test we make the disappearing timeout of overlay bigger so that tests don't fail on slow VMs (maybe useless). NOTE: coq error locations are quite wrong when we insert spaces (instead of a newline) after a command. PG was wrongly inserting a space after Set Silent./ Unset Silent, which triggered this problem. This is fixed by this PR. But other silent commends should triped of trailing blanks. I leave it to another PR.
61f8ab6
to
16b70c9
Compare
|
I decided to add the fix of hardwired command strings (removing trailing spaces) in a separate commit of this same PR. |
The failed CI is not related (reached VM limit). I merge now. |
Thanks a lot @Matafou ! sorry for replying late
It depends on the distribution you think of:
|
We cannot use the " ^^^ " thing to compute the error location because commands are not stripped of newlines anymore (#774).
Solution: use the character position information with the following subtleties