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

Fixes navigation from the macro-expansion tool to the macro-definition.

This commit is contained in:
Markus Schorn 2008-01-30 12:48:27 +00:00
parent 3c1338a8db
commit 199906029b

View file

@ -134,12 +134,15 @@ public class MultiMacroExpansionExplorer extends MacroExpansionExplorer {
private void addLocations(IASTPreprocessorMacroDefinition[] defs,
final Map<IMacroBinding, IASTFileLocation> result) {
for (IASTPreprocessorMacroDefinition def : defs) {
IASTFileLocation loc= def.getFileLocation();
if (loc != null) {
final IBinding binding= def.getName().getBinding();
if (binding instanceof IMacroBinding) {
loc= new ASTFileLocation(loc.getFileName(), loc.getNodeOffset(), loc.getNodeLength());
result.put((IMacroBinding) binding, loc);
IASTName name= def.getName();
if (name != null) {
IASTFileLocation loc= name.getFileLocation();
if (loc != null) {
final IBinding binding= name.getBinding();
if (binding instanceof IMacroBinding) {
loc= new ASTFileLocation(loc.getFileName(), loc.getNodeOffset(), loc.getNodeLength());
result.put((IMacroBinding) binding, loc);
}
}
}
}