Merge pull request #16953 from charlespierce/destructure_completion_nonpublic

Remove nonpublic members from destructuring completion lists
This commit is contained in:
Ron Buckton 2017-08-07 14:24:47 -07:00 committed by GitHub
commit 31230b9176
2 changed files with 10 additions and 1 deletions

View File

@ -1000,7 +1000,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();