Show progress when pre-calculating the AST during save #2414 #2415
+26
−1
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.
What it does
Fixes #2414
Show a progress dialog (after a delay) if the precalculation of the AST during a save takes too long.
Requires
This is to avoid the "flickering" of the progress dialog showing up and immediately disappearing when the calculation of the AST takes just a few milliseconds.
How to test
Expected outcome
If the AST takes a while to calculate then you should see a (non-cancelable) progress dialog.
Note
Since the methods that end up creating the AST do not really report progress with the monitor they receive, the progress dialog doesn't really show any progress (the bar does not move). I couldn't find any way around it but I'm open to suggestions.
A small hack to help testing
Add a delay to
org.eclipse.jdt.core.dom.ASTParser.createAST(IProgressMonitor)
Author checklist