#15214 Remove nonpublic members from destructuring completion lists

This commit is contained in:
Charles Pierce 2017-07-05 10:03:56 -07:00
parent 2a6aacd0ef
commit 228ce06461
2 changed files with 10 additions and 1 deletions

View file

@ -1002,7 +1002,7 @@ namespace ts.Completions {
const typeForObject = typeChecker.getTypeAtLocation(objectLikeContainer);
if (!typeForObject) return false;
// In a binding pattern, get only known properties. Everywhere else we will get all possible properties.
typeMembers = typeChecker.getPropertiesOfType(typeForObject);
typeMembers = typeChecker.getPropertiesOfType(typeForObject).filter((symbol) => !(getDeclarationModifierFlagsFromSymbol(symbol) & ModifierFlags.NonPublicAccessibilityModifier));
existingMembers = (<ObjectBindingPattern>objectLikeContainer).elements;
}
}

View file

@ -0,0 +1,9 @@
/// <reference path="fourslash.ts"/>
////const { b/**/ } = new class {
//// private ab;
//// protected bc;
////}
goTo.marker();
verify.completionListIsEmpty();