mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-03 22:35:43 +02:00
Follow up for deprecated methods in IASTTranslationUnit.
This commit is contained in:
parent
b3d789e035
commit
439c8752eb
1 changed files with 9 additions and 7 deletions
|
@ -85,13 +85,15 @@ public abstract class ASTNode implements IASTNode {
|
|||
if (length == 0) {
|
||||
locations= EMPTY_LOCATION_ARRAY;
|
||||
}
|
||||
final IASTTranslationUnit tu= getTranslationUnit();
|
||||
if (tu != null) {
|
||||
org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver l= (org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver) tu.getAdapter(org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver.class);
|
||||
if (l != null) {
|
||||
locations= l.getLocations(offset, length);
|
||||
}
|
||||
}
|
||||
else {
|
||||
final IASTTranslationUnit tu= getTranslationUnit();
|
||||
if (tu != null) {
|
||||
org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver l= (org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver) tu.getAdapter(org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver.class);
|
||||
if (l != null) {
|
||||
locations= l.getLocations(offset, length);
|
||||
}
|
||||
}
|
||||
}
|
||||
return locations;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue