1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-26 02:15: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(); IProject project = context.getProject();
c = desc[i].getCCompletionContributor(project); c = desc[i].getCCompletionContributor(project);
} }
IFunctionSummary f = c.getFunctionInfo(context, name); if (c != null) {
if (f != null) { IFunctionSummary f = c.getFunctionInfo(context, name);
return f; if (f != null) {
return f;
}
} }
} catch (CoreException e) { } catch (CoreException e) {
// //
@ -88,18 +90,17 @@ public class CCompletionContributorManager {
IProject project = context.getProject(); IProject project = context.getProject();
c = desc[i].getCCompletionContributor(project); c = desc[i].getCCompletionContributor(project);
} }
if (c == null) { if (c != null) {
continue; IFunctionSummary[] f = c.getMatchingFunctions(context, frag);
} if (f != null) {
IFunctionSummary[] f = c.getMatchingFunctions(context, frag); if (fs == null) {
if (f != null) { fs = f;
if (fs == null) { } else {
fs = f; IFunctionSummary[] dest = new IFunctionSummary[fs.length + f.length];
} else { System.arraycopy(fs, 0, dest, 0, fs.length);
IFunctionSummary[] dest = new IFunctionSummary[fs.length + f.length]; System.arraycopy(f, 0, dest, fs.length, f.length);
System.arraycopy(fs, 0, dest, 0, fs.length); fs = dest;
System.arraycopy(f, 0, dest, fs.length, f.length); }
fs = dest;
} }
} }
} catch (CoreException e) { } catch (CoreException e) {

View file

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