diff options
author | Sergey Prigogin | 2012-01-21 00:40:35 +0000 |
---|---|---|
committer | Sergey Prigogin | 2012-01-21 00:55:55 +0000 |
commit | 174abac647fe6c8108af2751819c67527ad5c9d1 (patch) | |
tree | 6a3c0025d5a8567a15ff9df3351dd2c818b8ac6e | |
parent | 03c9a71f0ad446078bd0847199ac6385a8809f74 (diff) | |
download | org.eclipse.cdt-174abac647fe6c8108af2751819c67527ad5c9d1.tar.gz org.eclipse.cdt-174abac647fe6c8108af2751819c67527ad5c9d1.tar.xz org.eclipse.cdt-174abac647fe6c8108af2751819c67527ad5c9d1.zip |
Don't wait for IndexUpdateRequestorJob in CEditor.dispose() since it
may cause a significant delay in "Close All" command.
-rw-r--r-- | core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java index 8a0a00b5fdb..5a3c8a17e2c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java @@ -1229,7 +1229,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC if (IndexerPreferences.KEY_INDEX_ON_OPEN.equals(event.getKey())) { ICElement element= getInputCElement(); ITranslationUnit tu = element != null ? (ITranslationUnit) element : null; - updateIndexInclusion(tu, false); + updateIndexInclusion(tu); } } @@ -1510,32 +1510,25 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC if (element instanceof ITranslationUnit) { ITranslationUnit tu = (ITranslationUnit) element; - updateIndexInclusion(tu, false); + updateIndexInclusion(tu); fBracketMatcher.configure(tu.getLanguage()); } else { - updateIndexInclusion(null, false); + updateIndexInclusion(null); fBracketMatcher.configure(null); } } - private void updateIndexInclusion(ITranslationUnit tu, boolean synchronous) { - if (tu!= null) { + private void updateIndexInclusion(ITranslationUnit tu) { + if (tu != null) { IProject project = tu.getCProject().getProject(); if (!String.valueOf(true).equals(IndexerPreferences.get(project, IndexerPreferences.KEY_INDEX_ON_OPEN, null))) { tu = null; } } - if (tu != null || fTuAddedToIndex != null) { + if ((tu != null || fTuAddedToIndex != null) && tu != fTuAddedToIndex) { IndexUpdateRequestorJob job = new IndexUpdateRequestorJob(tu, fTuAddedToIndex); fTuAddedToIndex = tu; job.schedule(); - if (synchronous) { - try { - job.join(); - } catch (InterruptedException e) { - // Ignore. - } - } } } @@ -2201,7 +2194,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC @Override public void dispose() { fIndexerPreferenceListener.unregister(); - updateIndexInclusion(null, true); + updateIndexInclusion(null); ISourceViewer sourceViewer = getSourceViewer(); if (sourceViewer instanceof ITextViewerExtension) |