1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-18 22:45:23 +02:00

Bug 412081 - Exception enabling mark occurrences on an external file

This commit is contained in:
Anton Leherbauer 2013-07-15 14:48:46 +02:00
parent 8b12c2d474
commit f04e9026a7

View file

@ -3576,13 +3576,17 @@ public class CEditor extends TextEditor implements ICEditor, ISelectionChangedLi
}; };
SelectionListenerWithASTManager.getDefault().addListener(this, fPostSelectionListenerWithAST); SelectionListenerWithASTManager.getDefault().addListener(this, fPostSelectionListenerWithAST);
if (forceUpdate && getSelectionProvider() != null) { if (forceUpdate && getSelectionProvider() != null) {
ICElement inputCElement = getInputCElement();
if (inputCElement instanceof ITranslationUnit) {
fForcedMarkOccurrencesSelection= getSelectionProvider().getSelection(); fForcedMarkOccurrencesSelection= getSelectionProvider().getSelection();
ASTProvider.getASTProvider().runOnAST(getInputCElement(), ASTProvider.WAIT_NO, getProgressMonitor(), new ASTRunnable() { ASTProvider.getASTProvider().runOnAST(inputCElement, ASTProvider.WAIT_NO, getProgressMonitor(), new ASTRunnable() {
@Override @Override
public IStatus runOnAST(ILanguage lang, IASTTranslationUnit ast) throws CoreException { public IStatus runOnAST(ILanguage lang, IASTTranslationUnit ast) throws CoreException {
updateOccurrenceAnnotations((ITextSelection) fForcedMarkOccurrencesSelection, ast); updateOccurrenceAnnotations((ITextSelection) fForcedMarkOccurrencesSelection, ast);
return Status.OK_STATUS; return Status.OK_STATUS;
}}); }
});
}
} }
if (fOccurrencesFinderJobCanceler == null) { if (fOccurrencesFinderJobCanceler == null) {