-
Notifications
You must be signed in to change notification settings - Fork 72
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
Cancel parsing event #941
Cancel parsing event #941
Conversation
4d7bc58
to
0f03284
Compare
This is a big one, still WIP. Needs:
|
In order to interupt a full document parse, we first need to make it part of the event loop.
ef1d45c
to
305a024
Compare
We introduce parse events for each line which will allow for better interuptibility as well as laying the ground work for blocking on parse errors.
…parsing is over This brings back performance to acceptable levels.
- Removed some commented out dead code - Cleaned up ParseEvent (it doesnt need any info) - Cleaned up the api (removed unecessary variables to init, reset, etc...) - Removed cancel handle for ParseEvent
Now instead of launching execution directly from the lsp event, we queue a new event that has less priority then parsing.
The operations on range lists used to compute the overview could be re-used somewhere else
This will allow to easily recompute the overview from an invalidated state, and makes a correspondance between an execution state and its overview.
This avoids two consecutive execution events happening at the same time and messing up the state. Additionally we move the parsing cancel handle to the document where it belongs.
We will now put the proof view handling in the document manager. Since ther return type for the handle event function is becoming quite big, we turn it into a record.
Even in continuous mode, observe_id will now indicate where the user clicked.
…, etc..) back in documentManager
8c8249a
to
cbb788d
Compare
3b4db9c
to
c487d8b
Compare
c487d8b
to
e13eadc
Compare
e13eadc
to
0e8c72d
Compare
(** [handle_event dpc ev] handles a parsing event for the document. One parsing event parses one line | ||
and prepares the next parsing event. Finally once the full parsing is done, the final event returs | ||
the id of the bottomost sentence of the prefix which has not changed since the previous validation | ||
as well as the set of invalidated sentences. *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should build a record for the return type, so that we can name all these documents
(** [init st opts uri text] initializes the document manager with initial vernac state | ||
[st] on which command line opts will be set. *) | ||
[st] on which command line opts will be set. [background] indicates if the document should | ||
be executed in the background once it is parsed. *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no background here
val clear_observe_id : state -> state | ||
(** [clear_observe_id state] updates the state to make the observe_id None *) | ||
id is updated. Finally if [background] is set to true, an execution is launched in | ||
the background *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no background here too
(** resets Coq *) | ||
|
||
val executed_ranges : state -> exec_overview | ||
val executed_ranges : state -> Settings.Mode.t -> exec_overview |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is unclear what the mode is for here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like a great cleanup
e98c4aa
to
7cfedb9
Compare
(** [handle_event dpc ev] handles a parsing event for the document. One parsing event parses one line | ||
and prepares the next parsing event. Finally once the full parsing is done, the final event returs | ||
the id of the bottomost sentence of the prefix which has not changed since the previous validation | ||
as well as the set of invalidated sentences. *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When parsing ends, we still have two documents, hence two cancelation handles. This is a bit confusing: which document should the client keep?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I catch your drift ? We have one "parsing" document which just became "parsed", and one "previous" document which is the version before all the new parsing events happened.
This makes the code way more readable
…k in continuous mode
Trying another route from #937.
This time we use the SEL api to cancel events.
Currently does not seem to be working because of problem noted in gares/sel#10
Closes #682.
Closes #914.