1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-12 18:55:38 +02:00

Bug 255272 - CReconciler blocks the UI thread

This commit is contained in:
Anton Leherbauer 2008-11-21 11:02:57 +00:00
parent 55049d6b86
commit 3de6df3b1e

View file

@ -1227,6 +1227,11 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
*/ */
private boolean fEnableScalablilityMode = false; private boolean fEnableScalablilityMode = false;
/**
* Flag indicating wheter the reconciler is currently running.
*/
private volatile boolean fIsReconciling;
private static final Set<String> angularIntroducers = new HashSet<String>(); private static final Set<String> angularIntroducers = new HashSet<String>();
static { static {
angularIntroducers.add("template"); //$NON-NLS-1$ angularIntroducers.add("template"); //$NON-NLS-1$
@ -1715,7 +1720,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
((IWorkingCopy) unit).reconcile(); ((IWorkingCopy) unit).reconcile();
} }
return unit.getElementAtOffset(offset); return unit.getElementAtOffset(offset);
} else if (unit.isStructureKnown() && unit.isConsistent()) { } else if (unit.isStructureKnown() && unit.isConsistent() && !fIsReconciling) {
return unit.getElementAtOffset(offset); return unit.getElementAtOffset(offset);
} }
} catch (CModelException x) { } catch (CModelException x) {
@ -2820,6 +2825,8 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
* @since 4.0 * @since 4.0
*/ */
public void aboutToBeReconciled() { public void aboutToBeReconciled() {
fIsReconciling= true;
// Notify AST provider // Notify AST provider
CUIPlugin.getDefault().getASTProvider().aboutToBeReconciled(getInputCElement()); CUIPlugin.getDefault().getASTProvider().aboutToBeReconciled(getInputCElement());
@ -2835,6 +2842,8 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
* @since 4.0 * @since 4.0
*/ */
public void reconciled(IASTTranslationUnit ast, boolean force, IProgressMonitor progressMonitor) { public void reconciled(IASTTranslationUnit ast, boolean force, IProgressMonitor progressMonitor) {
fIsReconciling= false;
CUIPlugin cuiPlugin= CUIPlugin.getDefault(); CUIPlugin cuiPlugin= CUIPlugin.getDefault();
if (cuiPlugin == null) if (cuiPlugin == null)
return; return;