1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 364942 - completion on include (ctrl+space) causes exception

This commit is contained in:
Anton Leherbauer 2011-11-28 16:32:53 +01:00
parent fc0097f131
commit 672f318deb

View file

@ -61,6 +61,7 @@ public class InclusionProposalComputer implements ICompletionProposalComputer {
private String fErrorMessage;
@Override
public List<ICompletionProposal> computeCompletionProposals(ContentAssistInvocationContext context, IProgressMonitor monitor) {
List<ICompletionProposal> proposals= Collections.emptyList();
fErrorMessage= null;
@ -81,17 +82,21 @@ public class InclusionProposalComputer implements ICompletionProposalComputer {
return proposals;
}
@Override
public List<IContextInformation> computeContextInformation(ContentAssistInvocationContext context, IProgressMonitor monitor) {
return null;
}
@Override
public String getErrorMessage() {
return fErrorMessage;
}
@Override
public void sessionEnded() {
}
@Override
public void sessionStarted() {
}
@ -257,6 +262,9 @@ public class InclusionProposalComputer implements ICompletionProposalComputer {
final int prefixLength = namePrefix.length();
final IProject project= tu.getCProject().getProject();
File[] files= fileDir.listFiles();
if (files == null) {
return;
}
IContentAssistMatcher matcher = ContentAssistMatcherFactory.getInstance().createMatcher(namePrefix);
for (File file : files) {
final String name= file.getName();
@ -311,6 +319,7 @@ public class InclusionProposalComputer implements ICompletionProposalComputer {
final IProject project= tu.getCProject().getProject();
parent.accept(new IResourceProxyVisitor() {
boolean fFirstVisit= true;
@Override
public boolean visit(IResourceProxy proxy) throws CoreException {
final int type= proxy.getType();
final String name= proxy.getName();