aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDawid Pakuła2018-05-22 17:04:13 -0400
committerDawid Pakula2018-05-30 06:46:19 -0400
commit2d007bbe59cf64cc8a95d59a4a4f748cd3a2487b (patch)
treef13bd57ecade06c08e11aced660a6c624ad92ae3
parent139f22c7d3a8ccd33d22f0294fd31d4078927dbd (diff)
downloadorg.eclipse.pdt-2d007bbe59cf64cc8a95d59a4a4f748cd3a2487b.zip
org.eclipse.pdt-2d007bbe59cf64cc8a95d59a4a4f748cd3a2487b.tar.gz
org.eclipse.pdt-2d007bbe59cf64cc8a95d59a4a4f748cd3a2487b.tar.xz
Bug 532610 - Occurrence annotations aren't correctly reconciled
Signed-off-by: Dawid Pakuła <zulus@w3des.net>
-rw-r--r--plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/viewsupport/SelectionListenerWithASTManager.java26
1 files changed, 20 insertions, 6 deletions
diff --git a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/viewsupport/SelectionListenerWithASTManager.java b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/viewsupport/SelectionListenerWithASTManager.java
index 56b2713..d2ae3dd 100644
--- a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/viewsupport/SelectionListenerWithASTManager.java
+++ b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/viewsupport/SelectionListenerWithASTManager.java
@@ -116,7 +116,7 @@ public class SelectionListenerWithASTManager {
* A selection event has occurred.
*
* @param selection
- * the selection
+ * the selection
*/
public void fireSelectionChanged(final ITextSelection selection) {
if (fCurrentJob != null) {
@@ -128,7 +128,7 @@ public class SelectionListenerWithASTManager {
* A post selection event has occurred.
*
* @param selection
- * the selection
+ * the selection
*/
public void firePostSelectionChanged(final ITextSelection selection) {
if (fCurrentJob != null) {
@@ -145,7 +145,21 @@ public class SelectionListenerWithASTManager {
if (monitor == null) {
monitor = new NullProgressMonitor();
}
+
+ try {
+ if (!typeRoot.isConsistent()) {
+ synchronized (this) {
+ if (!monitor.isCanceled()) {
+ schedule(1000);
+ }
+ }
+ return Status.OK_STATUS;
+ }
+ } catch (ModelException e) {
+ // never happens, fall thru
+ }
synchronized (fJobLock) {
+ // The monitor is never null
return calculateASTandInform(typeRoot, selection, monitor);
}
}
@@ -198,9 +212,9 @@ public class SelectionListenerWithASTManager {
* Registers a selection listener for the given editor part.
*
* @param part
- * The editor part to listen to.
+ * The editor part to listen to.
* @param listener
- * The listener to register.
+ * The listener to register.
*/
public void addListener(ITextEditor part, ISelectionListenerWithAST listener) {
synchronized (this) {
@@ -217,9 +231,9 @@ public class SelectionListenerWithASTManager {
* Unregisters a selection listener.
*
* @param part
- * The editor part the listener was registered.
+ * The editor part the listener was registered.
* @param listener
- * The listener to unregister.
+ * The listener to unregister.
*/
public void removeListener(ITextEditor part, ISelectionListenerWithAST listener) {
synchronized (this) {