1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

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>
This commit is contained in:
Nathan Ridge 2015-07-13 00:23:48 -04:00 committed by Sergey Prigogin
parent 28ed0a3d7a
commit 001e2c82f0
3 changed files with 6 additions and 1 deletions

View file

@ -238,7 +238,7 @@ class BaseClassLookup {
} }
ICPPClassType grandBaseClass = (ICPPClassType) grandBaseBinding; ICPPClassType grandBaseClass = (ICPPClassType) grandBaseBinding;
if (data.contentAssist && grandBaseClass instanceof ICPPDeferredClassInstance) { if (data.fHeuristicBaseLookup && grandBaseClass instanceof ICPPDeferredClassInstance) {
// Support content assist for members of deferred instances. // Support content assist for members of deferred instances.
grandBaseClass= ((ICPPDeferredClassInstance) grandBaseClass).getClassTemplate(); grandBaseClass= ((ICPPDeferredClassInstance) grandBaseClass).getClassTemplate();
} }

View file

@ -1151,6 +1151,7 @@ public class CPPSemantics {
ld2.setIgnorePointOfDeclaration(data.isIgnorePointOfDeclaration()); ld2.setIgnorePointOfDeclaration(data.isIgnorePointOfDeclaration());
ld2.contentAssist= data.contentAssist; ld2.contentAssist= data.contentAssist;
ld2.fNoNarrowing= data.fNoNarrowing; ld2.fNoNarrowing= data.fNoNarrowing;
ld2.fHeuristicBaseLookup= data.fHeuristicBaseLookup;
ld2.qualified= parent instanceof ICPPASTQualifiedName; ld2.qualified= parent instanceof ICPPASTQualifiedName;
ld2.typesOnly= true; ld2.typesOnly= true;
lookup(ld2, getLookupScope(typeDtorName)); lookup(ld2, getLookupScope(typeDtorName));
@ -3787,6 +3788,7 @@ public class CPPSemantics {
String[] additionalNamespaces) { String[] additionalNamespaces) {
LookupData data = createLookupData(name); LookupData data = createLookupData(name);
data.contentAssist = true; data.contentAssist = true;
data.fHeuristicBaseLookup = true;
data.setPrefixLookup(prefixLookup); data.setPrefixLookup(prefixLookup);
data.foundItems = new CharArrayObjectMap<>(2); data.foundItems = new CharArrayObjectMap<>(2);

View file

@ -103,6 +103,9 @@ public class LookupData extends ScopeLookupData {
public boolean argsContainImpliedObject; public boolean argsContainImpliedObject;
/** In list-initialization **/ /** In list-initialization **/
public boolean fNoNarrowing; 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 IASTDeclarator fDeclarator;
private boolean fFunctionCall; private boolean fFunctionCall;