1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 246363 - IllegalArgumentException while typing

This commit is contained in:
Anton Leherbauer 2008-09-08 11:00:22 +00:00
parent cce773e663
commit 18aa42e195

View file

@ -310,6 +310,9 @@ public class CSourceHover extends AbstractCEditorTextHover {
final int sourceStart;
final int sourceEnd;
IDocument doc= buffer.getDocument();
if (nameOffset >= doc.getLength() || nodeLength <= 0) {
return null;
}
if (binding instanceof IMacroBinding) {
ITypedRegion partition= TextUtilities.getPartition(doc, ICPartitions.C_PARTITIONING, nameOffset, false);
if (ICPartitions.C_PREPROCESSOR.equals(partition.getType())) {
@ -800,7 +803,12 @@ public class CSourceHover extends AbstractCEditorTextHover {
Job job= new Job(CHoverMessages.CSourceHover_jobTitle) {
@Override
protected IStatus run(IProgressMonitor monitor) {
return ASTProvider.getASTProvider().runOnAST(tUnit, ASTProvider.WAIT_ACTIVE_ONLY, monitor, computer);
try {
return ASTProvider.getASTProvider().runOnAST(tUnit, ASTProvider.WAIT_ACTIVE_ONLY, monitor, computer);
} catch (Throwable t) {
CUIPlugin.log(t);
}
return Status.CANCEL_STATUS;
}
};
// If the hover thread is interrupted this might have negative