Implement did_close()
and per-file diagnostics
#81
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A step towards posit-dev/positron#1005
Filled in
did_close()
, which should be useful if we decide we want to regenerate diagnostics for all open files.Also switched away from using a global variable for
DIAGNOSTICS_VERSION
altogether. I believe we can safely use the per-fileversion
for this, which is thread safe due to it being inside aDashMap
(aka mimicking aRwLock<HashMap>
). This change allows multiple files to enqueue diagnostics at the same time (i.e. we no longer cancel file A's diagnostics if file B enqueue's theirs), which will also be necessary for regenerating diagnostics for all open files.I originally thought I was having some kind of deadlock issue with this switch, but I think I may have just compiled a faulty version of ark on my end because the problem went away after a full recompile. It does make me slightly nervous though. I will keep an eye out for anything suspicious over the next few days.
454bae0 contains the switch to using a per-file version check, a941b77 is some further tweaking of
enqueue_diagnostics_impl()
so that it no longer needs to beasync
and has this clear responsibility ofDocument in -> Diagnostics out