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:
parent
3c1338a8db
commit
199906029b
1 changed files with 9 additions and 6 deletions
|
@ -134,12 +134,15 @@ public class MultiMacroExpansionExplorer extends MacroExpansionExplorer {
|
||||||
private void addLocations(IASTPreprocessorMacroDefinition[] defs,
|
private void addLocations(IASTPreprocessorMacroDefinition[] defs,
|
||||||
final Map<IMacroBinding, IASTFileLocation> result) {
|
final Map<IMacroBinding, IASTFileLocation> result) {
|
||||||
for (IASTPreprocessorMacroDefinition def : defs) {
|
for (IASTPreprocessorMacroDefinition def : defs) {
|
||||||
IASTFileLocation loc= def.getFileLocation();
|
IASTName name= def.getName();
|
||||||
if (loc != null) {
|
if (name != null) {
|
||||||
final IBinding binding= def.getName().getBinding();
|
IASTFileLocation loc= name.getFileLocation();
|
||||||
if (binding instanceof IMacroBinding) {
|
if (loc != null) {
|
||||||
loc= new ASTFileLocation(loc.getFileName(), loc.getNodeOffset(), loc.getNodeLength());
|
final IBinding binding= name.getBinding();
|
||||||
result.put((IMacroBinding) binding, loc);
|
if (binding instanceof IMacroBinding) {
|
||||||
|
loc= new ASTFileLocation(loc.getFileName(), loc.getNodeOffset(), loc.getNodeLength());
|
||||||
|
result.put((IMacroBinding) binding, loc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue