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:
parent
cce773e663
commit
18aa42e195
1 changed files with 9 additions and 1 deletions
|
@ -310,6 +310,9 @@ public class CSourceHover extends AbstractCEditorTextHover {
|
||||||
final int sourceStart;
|
final int sourceStart;
|
||||||
final int sourceEnd;
|
final int sourceEnd;
|
||||||
IDocument doc= buffer.getDocument();
|
IDocument doc= buffer.getDocument();
|
||||||
|
if (nameOffset >= doc.getLength() || nodeLength <= 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
if (binding instanceof IMacroBinding) {
|
if (binding instanceof IMacroBinding) {
|
||||||
ITypedRegion partition= TextUtilities.getPartition(doc, ICPartitions.C_PARTITIONING, nameOffset, false);
|
ITypedRegion partition= TextUtilities.getPartition(doc, ICPartitions.C_PARTITIONING, nameOffset, false);
|
||||||
if (ICPartitions.C_PREPROCESSOR.equals(partition.getType())) {
|
if (ICPartitions.C_PREPROCESSOR.equals(partition.getType())) {
|
||||||
|
@ -800,7 +803,12 @@ public class CSourceHover extends AbstractCEditorTextHover {
|
||||||
Job job= new Job(CHoverMessages.CSourceHover_jobTitle) {
|
Job job= new Job(CHoverMessages.CSourceHover_jobTitle) {
|
||||||
@Override
|
@Override
|
||||||
protected IStatus run(IProgressMonitor monitor) {
|
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
|
// If the hover thread is interrupted this might have negative
|
||||||
|
|
Loading…
Add table
Reference in a new issue