Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-Andre Laperle2011-03-16 13:10:04 -0400
committerMarc-Andre Laperle2011-03-16 13:10:04 -0400
commitbffecbbf9b28cd831f4537cca599884e8bcd6e52 (patch)
treeb29c9bf5fbb71fc0600e3563b00b675fb1739c60
parent0605ef71f92d8a8f66f6ae1a2cbc3b6de69bbcd5 (diff)
downloadorg.eclipse.cdt-bffecbbf9b28cd831f4537cca599884e8bcd6e52.tar.gz
org.eclipse.cdt-bffecbbf9b28cd831f4537cca599884e8bcd6e52.tar.xz
org.eclipse.cdt-bffecbbf9b28cd831f4537cca599884e8bcd6e52.zip
Bug 339931 - Code completion fails in #include statements
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/InclusionProposalComputer.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/InclusionProposalComputer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/InclusionProposalComputer.java
index e99dea5a81..2aa9e2b2ff 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/InclusionProposalComputer.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/InclusionProposalComputer.java
@@ -23,6 +23,7 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceProxy;
import org.eclipse.core.resources.IResourceProxyVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -289,8 +290,10 @@ public class InclusionProposalComputer implements ICompletionProposalComputer {
}
if (prefixPath.segmentCount() > 0) {
IPath parentPath = parent.getFullPath().append(prefixPath);
- if (parentPath.segmentCount() > 0) {
- parent= parent.getFolder(prefixPath);
+ if (parentPath.segmentCount() > 1) {
+ parent = parent.getFolder(prefixPath);
+ } else if (parentPath.segmentCount() == 1) {
+ parent = ResourcesPlugin.getWorkspace().getRoot().getProject(parentPath.lastSegment());
} else {
return;
}

Back to the top