1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-30 21:55:31 +02:00
This commit is contained in:
Alain Magloire 2004-08-12 20:03:00 +00:00
parent df84ae7f47
commit 6f7758e2db
2 changed files with 16 additions and 30 deletions

View file

@ -61,9 +61,11 @@ public class CCompletionContributorManager {
IProject project = context.getProject();
c = desc[i].getCCompletionContributor(project);
}
IFunctionSummary f = c.getFunctionInfo(context, name);
if (f != null) {
return f;
if (c != null) {
IFunctionSummary f = c.getFunctionInfo(context, name);
if (f != null) {
return f;
}
}
} catch (CoreException e) {
//
@ -88,18 +90,17 @@ public class CCompletionContributorManager {
IProject project = context.getProject();
c = desc[i].getCCompletionContributor(project);
}
if (c == null) {
continue;
}
IFunctionSummary[] f = c.getMatchingFunctions(context, frag);
if (f != null) {
if (fs == null) {
fs = f;
} else {
IFunctionSummary[] dest = new IFunctionSummary[fs.length + f.length];
System.arraycopy(fs, 0, dest, 0, fs.length);
System.arraycopy(f, 0, dest, fs.length, f.length);
fs = dest;
if (c != null) {
IFunctionSummary[] f = c.getMatchingFunctions(context, frag);
if (f != null) {
if (fs == null) {
fs = f;
} else {
IFunctionSummary[] dest = new IFunctionSummary[fs.length + f.length];
System.arraycopy(fs, 0, dest, 0, fs.length);
System.arraycopy(f, 0, dest, fs.length, f.length);
fs = dest;
}
}
}
} catch (CoreException e) {

View file

@ -37,7 +37,6 @@ public class CCompletionContributorDescriptor {
private IConfigurationElement fConfigurationElement;
private ICCompletionContributor fContributorInstance;
private ITranslationUnit fLastUnit;
private Boolean fStatus;
private boolean fLastResult;
private static final String ID= "id"; //$NON-NLS-1$
@ -47,10 +46,6 @@ public class CCompletionContributorDescriptor {
fConfigurationElement= element;
fContributorInstance= null;
fLastUnit= null;
fStatus= null; // undefined
if (fConfigurationElement.getChildren(ExpressionTagNames.ENABLEMENT).length == 0) {
fStatus= Boolean.TRUE;
}
}
public IStatus checkSyntax() {
@ -63,10 +58,6 @@ public class CCompletionContributorDescriptor {
}
private boolean matches(ITranslationUnit unit) {
if (fStatus != null) {
return fStatus.booleanValue();
}
IConfigurationElement[] children= fConfigurationElement.getChildren(ExpressionTagNames.ENABLEMENT);
if (children.length == 1) {
if (unit.equals(fLastUnit)) {
@ -87,7 +78,6 @@ public class CCompletionContributorDescriptor {
CUIPlugin.getDefault().log(e);
}
}
fStatus= Boolean.FALSE;
return false;
}
@ -118,10 +108,6 @@ public class CCompletionContributorDescriptor {
private boolean matches(IProject project) {
if (fStatus != null) {
return fStatus.booleanValue();
}
IConfigurationElement[] children= fConfigurationElement.getChildren(ExpressionTagNames.ENABLEMENT);
if (children.length == 1 && project != null) {
try {
@ -137,7 +123,6 @@ public class CCompletionContributorDescriptor {
CUIPlugin.getDefault().log(e);
}
}
fStatus= Boolean.FALSE;
return false;
}