mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-01 13:25:45 +02:00
fix failing refactor tests
This commit is contained in:
parent
77df20e6f9
commit
585cbe890c
1 changed files with 8 additions and 0 deletions
|
@ -145,6 +145,7 @@ public class CPPSemantics {
|
||||||
this.name = n;
|
this.name = n;
|
||||||
}
|
}
|
||||||
public boolean includeBlockItem( IASTNode item ){
|
public boolean includeBlockItem( IASTNode item ){
|
||||||
|
if( astName.getPropertyInParent() == STRING_LOOKUP_PROPERTY ) return true;
|
||||||
if( ( astName != null && astName.getParent() instanceof IASTIdExpression ) ||
|
if( ( astName != null && astName.getParent() instanceof IASTIdExpression ) ||
|
||||||
item instanceof IASTNamespaceDefinition ||
|
item instanceof IASTNamespaceDefinition ||
|
||||||
(item instanceof IASTSimpleDeclaration && ((IASTSimpleDeclaration)item).getDeclSpecifier() instanceof IASTCompositeTypeSpecifier ) )
|
(item instanceof IASTSimpleDeclaration && ((IASTSimpleDeclaration)item).getDeclSpecifier() instanceof IASTCompositeTypeSpecifier ) )
|
||||||
|
@ -155,6 +156,7 @@ public class CPPSemantics {
|
||||||
}
|
}
|
||||||
private boolean typesOnly(){
|
private boolean typesOnly(){
|
||||||
if( astName == null ) return false;
|
if( astName == null ) return false;
|
||||||
|
if( astName.getPropertyInParent() == STRING_LOOKUP_PROPERTY ) return false;
|
||||||
IASTNode parent = astName.getParent();
|
IASTNode parent = astName.getParent();
|
||||||
if( parent instanceof ICPPASTBaseSpecifier || parent instanceof ICPPASTElaboratedTypeSpecifier ||
|
if( parent instanceof ICPPASTBaseSpecifier || parent instanceof ICPPASTElaboratedTypeSpecifier ||
|
||||||
parent instanceof ICPPASTCompositeTypeSpecifier )
|
parent instanceof ICPPASTCompositeTypeSpecifier )
|
||||||
|
@ -167,6 +169,7 @@ public class CPPSemantics {
|
||||||
}
|
}
|
||||||
public boolean forUsingDeclaration(){
|
public boolean forUsingDeclaration(){
|
||||||
if( astName == null ) return false;
|
if( astName == null ) return false;
|
||||||
|
if( astName.getPropertyInParent() == STRING_LOOKUP_PROPERTY ) return false;
|
||||||
IASTNode p1 = astName.getParent();
|
IASTNode p1 = astName.getParent();
|
||||||
if( p1 instanceof ICPPASTUsingDeclaration )
|
if( p1 instanceof ICPPASTUsingDeclaration )
|
||||||
return true;
|
return true;
|
||||||
|
@ -182,6 +185,7 @@ public class CPPSemantics {
|
||||||
}
|
}
|
||||||
public boolean forDefinition(){
|
public boolean forDefinition(){
|
||||||
if( astName == null ) return false;
|
if( astName == null ) return false;
|
||||||
|
if( astName.getPropertyInParent() == STRING_LOOKUP_PROPERTY ) return false;
|
||||||
IASTNode p1 = astName.getParent();
|
IASTNode p1 = astName.getParent();
|
||||||
IASTNode p2 = p1.getParent();
|
IASTNode p2 = p1.getParent();
|
||||||
|
|
||||||
|
@ -191,6 +195,7 @@ public class CPPSemantics {
|
||||||
}
|
}
|
||||||
private boolean considerConstructors(){
|
private boolean considerConstructors(){
|
||||||
if( astName == null ) return false;
|
if( astName == null ) return false;
|
||||||
|
if( astName.getPropertyInParent() == STRING_LOOKUP_PROPERTY ) return false;
|
||||||
IASTNode p1 = astName.getParent();
|
IASTNode p1 = astName.getParent();
|
||||||
IASTNode p2 = p1.getParent();
|
IASTNode p2 = p1.getParent();
|
||||||
|
|
||||||
|
@ -210,6 +215,7 @@ public class CPPSemantics {
|
||||||
public boolean qualified(){
|
public boolean qualified(){
|
||||||
if( forceQualified ) return true;
|
if( forceQualified ) return true;
|
||||||
if( astName == null ) return false;
|
if( astName == null ) return false;
|
||||||
|
if( astName.getPropertyInParent() == STRING_LOOKUP_PROPERTY ) return false;
|
||||||
IASTNode p1 = astName.getParent();
|
IASTNode p1 = astName.getParent();
|
||||||
if( p1 instanceof ICPPASTQualifiedName ){
|
if( p1 instanceof ICPPASTQualifiedName ){
|
||||||
return ((ICPPASTQualifiedName)p1).getNames()[0] != astName;
|
return ((ICPPASTQualifiedName)p1).getNames()[0] != astName;
|
||||||
|
@ -218,6 +224,7 @@ public class CPPSemantics {
|
||||||
}
|
}
|
||||||
public boolean functionCall(){
|
public boolean functionCall(){
|
||||||
if( astName == null ) return false;
|
if( astName == null ) return false;
|
||||||
|
if( astName.getPropertyInParent() == STRING_LOOKUP_PROPERTY ) return false;
|
||||||
IASTNode p1 = astName.getParent();
|
IASTNode p1 = astName.getParent();
|
||||||
if( p1 instanceof ICPPASTQualifiedName )
|
if( p1 instanceof ICPPASTQualifiedName )
|
||||||
p1 = p1.getParent();
|
p1 = p1.getParent();
|
||||||
|
@ -225,6 +232,7 @@ public class CPPSemantics {
|
||||||
}
|
}
|
||||||
public boolean checkWholeClassScope() {
|
public boolean checkWholeClassScope() {
|
||||||
if( astName == null ) return false;
|
if( astName == null ) return false;
|
||||||
|
if( astName.getPropertyInParent() == STRING_LOOKUP_PROPERTY ) return true;
|
||||||
ASTNodeProperty prop = astName.getPropertyInParent();
|
ASTNodeProperty prop = astName.getPropertyInParent();
|
||||||
if( prop == IASTIdExpression.ID_NAME ||
|
if( prop == IASTIdExpression.ID_NAME ||
|
||||||
prop == IASTFieldReference.FIELD_NAME ||
|
prop == IASTFieldReference.FIELD_NAME ||
|
||||||
|
|
Loading…
Add table
Reference in a new issue