Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorNathan Ridge2015-07-13 04:23:48 +0000
committerSergey Prigogin2015-07-13 20:54:53 +0000
commit001e2c82f082348ad213feecaffb003c3b784900 (patch)
tree5e6fdc8a011f1523dc7bc859bfb77f064d28e1a2 /core
parent28ed0a3d7a8ce3fc260766cb9bc2e719ca665f54 (diff)
downloadorg.eclipse.cdt-001e2c82f082348ad213feecaffb003c3b784900.tar.gz
org.eclipse.cdt-001e2c82f082348ad213feecaffb003c3b784900.tar.xz
org.eclipse.cdt-001e2c82f082348ad213feecaffb003c3b784900.zip
Bug 421823 - Allow consumers other than content assist to perform
heuristic base class lookup Change-Id: I8add635bb62a0241b7de9430a32f85499535085d Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/BaseClassLookup.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/LookupData.java3
3 files changed, 6 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/BaseClassLookup.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/BaseClassLookup.java
index e7870df977..fa81745af6 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/BaseClassLookup.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/BaseClassLookup.java
@@ -238,7 +238,7 @@ class BaseClassLookup {
}
ICPPClassType grandBaseClass = (ICPPClassType) grandBaseBinding;
- if (data.contentAssist && grandBaseClass instanceof ICPPDeferredClassInstance) {
+ if (data.fHeuristicBaseLookup && grandBaseClass instanceof ICPPDeferredClassInstance) {
// Support content assist for members of deferred instances.
grandBaseClass= ((ICPPDeferredClassInstance) grandBaseClass).getClassTemplate();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
index e777ba1c0a..3c9a481d66 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
@@ -1151,6 +1151,7 @@ public class CPPSemantics {
ld2.setIgnorePointOfDeclaration(data.isIgnorePointOfDeclaration());
ld2.contentAssist= data.contentAssist;
ld2.fNoNarrowing= data.fNoNarrowing;
+ ld2.fHeuristicBaseLookup= data.fHeuristicBaseLookup;
ld2.qualified= parent instanceof ICPPASTQualifiedName;
ld2.typesOnly= true;
lookup(ld2, getLookupScope(typeDtorName));
@@ -3787,6 +3788,7 @@ public class CPPSemantics {
String[] additionalNamespaces) {
LookupData data = createLookupData(name);
data.contentAssist = true;
+ data.fHeuristicBaseLookup = true;
data.setPrefixLookup(prefixLookup);
data.foundItems = new CharArrayObjectMap<>(2);
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/LookupData.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/LookupData.java
index 51426f5eb3..b1649124a3 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/LookupData.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/LookupData.java
@@ -103,6 +103,9 @@ public class LookupData extends ScopeLookupData {
public boolean argsContainImpliedObject;
/** In list-initialization **/
public boolean fNoNarrowing;
+ /** When doing lookup in base classes, replace deferred class instances with their class template.
+ * This is used by editor actions like content assist. */
+ public boolean fHeuristicBaseLookup;
private IASTDeclarator fDeclarator;
private boolean fFunctionCall;

Back to the top