diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5656e5e22c2..b0a74e778fa 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11802,7 +11802,7 @@ namespace ts { return getReducedType(getApparentType(getReducedType(type))); } - function createUnionOrIntersectionProperty(containingType: UnionOrIntersectionType, name: __String, skipObjectFunctionPropertyAugment?: boolean): Symbol | undefined { // candidate + function createUnionOrIntersectionProperty(containingType: UnionOrIntersectionType, name: __String, skipObjectFunctionPropertyAugment?: boolean): Symbol | undefined { let singleProp: Symbol | undefined; let propSet: ESMap | undefined; let indexTypes: Type[] | undefined; diff --git a/src/services/completions.ts b/src/services/completions.ts index a1cf6eb49a6..52c9b3325a9 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -2213,22 +2213,12 @@ namespace ts.Completions { canGetType = isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent as Expression); } } - if (canGetType) { // here + if (canGetType) { const typeForObject = typeChecker.getTypeAtLocation(objectLikeContainer); if (!typeForObject) return GlobalsSearch.Fail; - // In a binding pattern, get only known properties (unless in the same scope). - // Everywhere else we will get all possible properties. - - // const containerClass = getContainingClass(objectLikeContainer); typeMembers = typeChecker.getPropertiesOfType(typeForObject).filter(propertySymbol => { return typeChecker.isPropertyAccessible(objectLikeContainer, /*isSuper*/ false, /*writing*/ false, typeForObject, propertySymbol); - // return !(getDeclarationModifierFlagsFromSymbol(propertySymbol) & ModifierFlags.NonPublicAccessibilityModifier) - // || containerClass && contains(typeForObject.symbol.declarations, containerClass); }); - // // either public - // !(getDeclarationModifierFlagsFromSymbol(symbol) & ModifierFlags.NonPublicAccessibilityModifier) - // // or we're in it - // || containerClass && contains(typeForObject.symbol.declarations, containerClass)); existingMembers = objectLikeContainer.elements; } }