diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/DOMSearchUtil.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/DOMSearchUtil.java index f0a9ebc4721..204293cf8c2 100644 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/DOMSearchUtil.java +++ b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/DOMSearchUtil.java @@ -337,7 +337,8 @@ public class DOMSearchUtil { private static IASTName[] getNames(IASTTranslationUnit tu, IBinding binding, LimitTo limitTo) { IASTName[] names = null; - if (limitTo == ICSearchConstants.DECLARATIONS) { + if (limitTo == ICSearchConstants.DECLARATIONS || + limitTo == ICSearchConstants.DECLARATIONS_DEFINITIONS) { names = tu.getDeclarations(binding); } else if (limitTo == ICSearchConstants.REFERENCES) { names = tu.getReferences(binding); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java index a787ec9c76a..84f7c625d2e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java @@ -513,8 +513,19 @@ public class CSearchPage extends DialogPage implements ISearchPage, ICSearchCons String text; try { text= reader.readLine(); - if (text == null) + if (text == null){ text= ""; //$NON-NLS-1$ + } else { + //The user has selected something - we don't want to "redo" too much of the selection + //but we need to ensure that it has the maximum chance of matching something in the index. + //So we need to: i) get rid of any semi-colons if there are any + + int indexSemi = text.indexOf(';'); + //Check to see if there are any semi-colons in the selected string, if there are select up to the semi colon + if (indexSemi != -1){ + text = text.substring(0, indexSemi); + } + } } catch (IOException ex) { text= ""; //$NON-NLS-1$ }