From 8fb7e7383f4b374fb10049f47f29b2890c2699ec Mon Sep 17 00:00:00 2001 From: Vladimir Hirsl Date: Mon, 2 May 2005 17:44:39 +0000 Subject: [PATCH] Fix for PR 96762: DOM indexer misses some obvious symbols Fixed calculation of file locations for names inside macro definitions. --- core/org.eclipse.cdt.core/ChangeLog | 6 ++++++ .../core/index/domsourceindexer/IndexEncoderUtil.java | 8 +++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/core/org.eclipse.cdt.core/ChangeLog b/core/org.eclipse.cdt.core/ChangeLog index d35959483b3..1e0ff3891c5 100644 --- a/core/org.eclipse.cdt.core/ChangeLog +++ b/core/org.eclipse.cdt.core/ChangeLog @@ -1,3 +1,9 @@ +2005-05-02 Vladimir Hirsl + Fix for PR 96762: DOM indexer misses some obvious symbols + Fixed calculation of file locations for names inside macro definitions + + * index/org/eclipse/cdt/internal/core/index/domsourceindexer/IndexEncoderUtil.java + 2005-04-28 Alain Magloire Patch from Devlin Steffler FIXED 84606- CDT needs to take advantage of background refresh of projects diff --git a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/domsourceindexer/IndexEncoderUtil.java b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/domsourceindexer/IndexEncoderUtil.java index c2f5e06b00b..3afa3268031 100644 --- a/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/domsourceindexer/IndexEncoderUtil.java +++ b/core/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/index/domsourceindexer/IndexEncoderUtil.java @@ -74,12 +74,10 @@ public class IndexEncoderUtil { IASTFileLocation fileLoc = null; IASTNodeLocation[] locs = node.getNodeLocations(); - if (locs.length == 1) { - if (locs[0] instanceof IASTFileLocation) { - fileLoc = (IASTFileLocation) locs[0]; - } + if (locs.length == 1 && locs[0] instanceof IASTFileLocation) { + fileLoc = (IASTFileLocation) locs[0]; } - else if (locs.length > 1) { + else if (locs.length > 0) { fileLoc = node.getTranslationUnit().flattenLocationsToFile(locs); } return fileLoc;