1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

fix bug 54169 - Search fails to find enum declaration

This commit is contained in:
Andrew Niefer 2004-04-05 20:52:21 +00:00
parent ff806b07d1
commit 3f436ae1eb
4 changed files with 23 additions and 1 deletions

View file

@ -1,3 +1,6 @@
2004-04-05 Andrew Niefer
added search/org/eclipse/cdt/core/search/tests/ClassDeclarationPatternTests.testBug54169()
2004-04-05 Andrew Niefer 2004-04-05 Andrew Niefer
Added parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTemplateTest.testTemplateParametersInExpressions Added parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTemplateTest.testTemplateParametersInExpressions

View file

@ -278,5 +278,19 @@ public class ClassDeclarationPatternTests extends BaseSearchTest implements ICSe
assertEquals( matches.size(), 2 ); assertEquals( matches.size(), 2 );
} }
public void testBug54169(){
ICSearchPattern pattern = SearchEngine.createSearchPattern( "e", TYPE, DECLARATIONS, true );
search( workspace, pattern, scope, resultCollector );
Set matches = resultCollector.getSearchResults();
assertEquals( matches.size(), 1 );
pattern = SearchEngine.createSearchPattern( "NS_B", TYPE, DECLARATIONS, true );
search( workspace, pattern, scope, resultCollector );
matches = resultCollector.getSearchResults();
assertEquals( matches.size(), 1 );
}
} }

View file

@ -1,3 +1,6 @@
2004-04-05 Andrew Niefer
fix bug 54169, TYPE includes enum & typedef, handle that in ClassDeclarationPattern.matchLevel
2004-03-24 Bogdan Gheorghe 2004-03-24 Bogdan Gheorghe
Modified BasicSearchMatch to keep track of what files contained the match in order Modified BasicSearchMatch to keep track of what files contained the match in order
to create file links to support external file markers. to create file links to support external file markers.

View file

@ -80,7 +80,9 @@ public class ClassDeclarationPattern extends CSearchPattern {
if( !( node instanceof IASTEnumerationSpecifier ) ) if( !( node instanceof IASTEnumerationSpecifier ) )
return IMPOSSIBLE_MATCH; return IMPOSSIBLE_MATCH;
} else if ( !( node instanceof IASTClassSpecifier ) && } else if ( !( node instanceof IASTClassSpecifier ) &&
!( node instanceof IASTElaboratedTypeSpecifier ) ) !( node instanceof IASTElaboratedTypeSpecifier ) &&
!( node instanceof IASTTypedefDeclaration ) &&
!( node instanceof IASTEnumerationSpecifier) )
{ {
return IMPOSSIBLE_MATCH; return IMPOSSIBLE_MATCH;
} }