| Summary: | [editor][performance] SelectionListenerWithASTManager does not cancel previous selection calculation if switching editors | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] JSDT | Reporter: | Ian Tewksbury <itewksbu> | ||||||
| Component: | General | Assignee: | Ian Tewksbury <itewksbu> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | Nitin Dahyabhai <thatnitind> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | cmjaun | ||||||
| Version: | 3.2.3 | Flags: | thatnitind:
review+
|
||||||
| Target Milestone: | 3.3.1 | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Ian Tewksbury
Created attachment 195848 [details]
Fix Patch
This patch does three things.
It updates the SelectionListenerWithASTManager so that it will cancel all selection jobs if a the selection changes instead of just the one in the current editor.
The second thing it does is update JavaScriptUnitResolver to check its canceled status more often. More specifically now it will check it before and after every call to one of the #accept methods.
Lastly the CancelableProblemFactory is updated to throw an OperationCanceledException rather then an AbortCompilation exception so that the exception gets handled by the correct catch blocks. As an AbortCompilation exception it would be logged, but there is no need to log this because it is a legal state to get into.
Although IProgressMonitor#worked() only requires a non-negative number, I'm not comfortable with it being called with 0. Created attachment 197493 [details]
Fix Patch - Update 1
Same solution as my first patch except a new function is created to check the cancelled state of the monitor so 0 is no longer passed to #worked().
Approved and committed. |