1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-26 10:25:32 +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,10 +61,12 @@ public class CCompletionContributorManager {
IProject project = context.getProject(); IProject project = context.getProject();
c = desc[i].getCCompletionContributor(project); c = desc[i].getCCompletionContributor(project);
} }
if (c != null) {
IFunctionSummary f = c.getFunctionInfo(context, name); IFunctionSummary f = c.getFunctionInfo(context, name);
if (f != null) { if (f != null) {
return f; return f;
} }
}
} catch (CoreException e) { } catch (CoreException e) {
// //
} }
@ -88,9 +90,7 @@ 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); IFunctionSummary[] f = c.getMatchingFunctions(context, frag);
if (f != null) { if (f != null) {
if (fs == null) { if (fs == null) {
@ -102,6 +102,7 @@ public class CCompletionContributorManager {
fs = dest; 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;
} }