mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for 200796, [Content Asssit] proposals for deleted or renamed fields in C.
This commit is contained in:
parent
306eb7d948
commit
8c03d14f4c
1 changed files with 15 additions and 8 deletions
|
@ -29,6 +29,7 @@ import org.eclipse.cdt.core.dom.ast.IType;
|
|||
import org.eclipse.cdt.core.dom.ast.ITypedef;
|
||||
import org.eclipse.cdt.core.dom.ast.c.ICCompositeTypeScope;
|
||||
import org.eclipse.cdt.core.index.IIndexBinding;
|
||||
import org.eclipse.cdt.core.index.IndexFilter;
|
||||
import org.eclipse.cdt.internal.core.Util;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexCBindingConstants;
|
||||
import org.eclipse.cdt.internal.core.index.IIndexScope;
|
||||
|
@ -108,8 +109,12 @@ public class PDOMCStructure extends PDOMBinding implements ICompositeType, ICCom
|
|||
private static class GetFields implements IPDOMVisitor {
|
||||
private List fields = new ArrayList();
|
||||
public boolean visit(IPDOMNode node) throws CoreException {
|
||||
if (node instanceof IField)
|
||||
if (node instanceof IField) {
|
||||
IField field= (IField) node;
|
||||
if (IndexFilter.ALL_DECLARED_OR_IMPLICIT.acceptBinding(field)) {
|
||||
fields.add(node);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public void leave(IPDOMNode node) throws CoreException {
|
||||
|
@ -138,11 +143,13 @@ public class PDOMCStructure extends PDOMBinding implements ICompositeType, ICCom
|
|||
public boolean visit(IPDOMNode node) throws CoreException {
|
||||
if (node instanceof IField) {
|
||||
IField tField = (IField)node;
|
||||
if (IndexFilter.ALL_DECLARED_OR_IMPLICIT.acceptBinding(tField)) {
|
||||
if (name.equals(tField.getName())) {
|
||||
field = tField;
|
||||
throw new CoreException(Status.OK_STATUS);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public void leave(IPDOMNode node) throws CoreException {
|
||||
|
|
Loading…
Add table
Reference in a new issue