mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-13 19:25:38 +02:00
Bug 255272 - CReconciler blocks the UI thread
This commit is contained in:
parent
55049d6b86
commit
3de6df3b1e
1 changed files with 10 additions and 1 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue