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