#15214 Remove nonpublic members from destructuring completion lists
This commit is contained in:
parent
2a6aacd0ef
commit
228ce06461
2 changed files with 10 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
/// <reference path="fourslash.ts"/>
|
||||
|
||||
////const { b/**/ } = new class {
|
||||
//// private ab;
|
||||
//// protected bc;
|
||||
////}
|
||||
|
||||
goTo.marker();
|
||||
verify.completionListIsEmpty();
|
Loading…
Reference in a new issue