Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorBogdan Gheorghe2005-06-27 19:13:00 +0000
committerBogdan Gheorghe2005-06-27 19:13:00 +0000
commitc79f8eb661f17f6e47a8ca9174f3bd8d98ccd70f (patch)
treedc0033718d1b3ca5aee3bd79bd884ade698c5984 /core
parentd30c9cee802514d5896020e92ac71599c1fee2f7 (diff)
downloadorg.eclipse.cdt-c79f8eb661f17f6e47a8ca9174f3bd8d98ccd70f.tar.gz
org.eclipse.cdt-c79f8eb661f17f6e47a8ca9174f3bd8d98ccd70f.tar.xz
org.eclipse.cdt-c79f8eb661f17f6e47a8ca9174f3bd8d98ccd70f.zip
Fix for 101903: Junit failures for RC1
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/DOMSearchUtil.java3
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java13
2 files changed, 14 insertions, 2 deletions
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$
}

Back to the top