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,9 +134,11 @@ public class MultiMacroExpansionExplorer extends MacroExpansionExplorer {
|
|||
private void addLocations(IASTPreprocessorMacroDefinition[] defs,
|
||||
final Map<IMacroBinding, IASTFileLocation> result) {
|
||||
for (IASTPreprocessorMacroDefinition def : defs) {
|
||||
IASTFileLocation loc= def.getFileLocation();
|
||||
IASTName name= def.getName();
|
||||
if (name != null) {
|
||||
IASTFileLocation loc= name.getFileLocation();
|
||||
if (loc != null) {
|
||||
final IBinding binding= def.getName().getBinding();
|
||||
final IBinding binding= name.getBinding();
|
||||
if (binding instanceof IMacroBinding) {
|
||||
loc= new ASTFileLocation(loc.getFileName(), loc.getNodeOffset(), loc.getNodeLength());
|
||||
result.put((IMacroBinding) binding, loc);
|
||||
|
@ -144,6 +146,7 @@ public class MultiMacroExpansionExplorer extends MacroExpansionExplorer {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public MultiMacroExpansionExplorer(final IASTTranslationUnit tu, final IRegion loc) {
|
||||
this(tu, new ASTFileLocation(tu.getFilePath(), loc.getOffset(), loc.getLength()));
|
||||
|
|
Loading…
Add table
Reference in a new issue