mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Bug 407807 - [Content Assist] No completion for members of object that
shadows object in base class Change-Id: I30bf6064de788f766f871cdea1776d849c8284c5 Reviewed-on: https://git.eclipse.org/r/12733 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
parent
e5d12140df
commit
5189876f06
2 changed files with 25 additions and 1 deletions
|
@ -2274,7 +2274,10 @@ public class CPPSemantics {
|
|||
return true;
|
||||
}
|
||||
IIndexFileSet indexFileSet = ast.getIndexFileSet();
|
||||
return indexFileSet != null && indexFileSet.containsDeclaration(indexBinding);
|
||||
IIndexFileSet astFileSet = ast.getASTFileSet();
|
||||
return indexFileSet != null &&
|
||||
(indexFileSet.containsDeclaration(indexBinding) ||
|
||||
astFileSet.containsDeclaration(indexBinding));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1380,4 +1380,25 @@ public class CompletionTests extends AbstractContentAssistTest {
|
|||
final String[] expected= { "typename" };
|
||||
assertContentAssistResults(fCursorOffset, 0, expected, true, false, false, COMPARE_REP_STRINGS);
|
||||
}
|
||||
|
||||
// class Base {
|
||||
// int c;
|
||||
// };
|
||||
//
|
||||
// struct Cat {
|
||||
// void meow();
|
||||
// };
|
||||
//
|
||||
// struct Derived : Base {
|
||||
// void foo() {
|
||||
// c./*cursor*/
|
||||
// }
|
||||
//
|
||||
// Cat c;
|
||||
// };
|
||||
public void testShadowingBaseClassMember_Bug407807() throws Exception {
|
||||
final String[] expected = { "Cat", "meow(void)" };
|
||||
assertContentAssistResults(fCursorOffset, expected, true, COMPARE_ID_STRINGS);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue