mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Fix NoSuchElementException if no comment
This commit is contained in:
parent
fc309c3e02
commit
db3183d89f
1 changed files with 13 additions and 11 deletions
|
@ -1252,6 +1252,7 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi
|
|||
comments.add(new Tuple(new CProjectionAnnotation(collapse, doc.get(projection.offset, Math.min(16, projection.length)), true), projection));
|
||||
}
|
||||
}
|
||||
if (!comments.isEmpty()) {
|
||||
// first comment is header comment
|
||||
Iterator iter = comments.iterator();
|
||||
Tuple tuple = (Tuple) iter.next();
|
||||
|
@ -1266,6 +1267,7 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi
|
|||
ctx.addProjectionRange(tuple.annotation, tuple.position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void computeFoldingStructure(ICElement[] elements, FoldingStructureComputationContext ctx) throws CModelException {
|
||||
for (int i= 0; i < elements.length; i++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue