Filter private mebemers in class completions
This commit is contained in:
parent
44adc06496
commit
5db12f357f
2 changed files with 12 additions and 2 deletions
|
@ -1815,7 +1815,17 @@ module ts {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
var symbols = apparentType.getApparentProperties();
|
||||
var containingClass = getAncestor(mappedNode, SyntaxKind.ClassDeclaration);
|
||||
|
||||
var symbols: Symbol[] = [];
|
||||
// Filter private properties
|
||||
forEach(apparentType.getApparentProperties(), symbol => {
|
||||
var declaration = symbol.declarations && symbol.declarations[0];
|
||||
if (declaration && declaration.flags & NodeFlags.Private && containingClass !== declaration.parent)
|
||||
return;
|
||||
|
||||
symbols.push(symbol);
|
||||
});
|
||||
isMemberCompletion = true;
|
||||
getCompletionEntriesFromSymbols(symbols, activeCompletionSession);
|
||||
}
|
||||
|
|
|
@ -12,5 +12,5 @@
|
|||
goTo.marker();
|
||||
debug.printCompletionListMembers();
|
||||
verify.memberListCount(2);
|
||||
verify.memberListContains('pubMeth', '(): void');
|
||||
verify.memberListContains('pubMeth', '() => void');
|
||||
verify.memberListContains('pubProp', 'number');
|
Loading…
Reference in a new issue