mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
#15214 Remove nonpublic members from destructuring completion lists
This commit is contained in:
parent
2a6aacd0ef
commit
228ce06461
@ -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…
x
Reference in New Issue
Block a user