fix(37364): show completions for string literal index on mapped type (#37367)

This commit is contained in:
Alexander T
2020-04-10 19:36:26 +03:00
committed by GitHub
parent 52dc9f2282
commit aa6be6ee6f
2 changed files with 21 additions and 1 deletions

View File

@@ -223,7 +223,9 @@ namespace ts.Completions.StringCompletions {
function stringLiteralCompletionsFromProperties(type: Type | undefined): StringLiteralCompletionsFromProperties | undefined {
return type && {
kind: StringLiteralCompletionKind.Properties,
symbols: type.getApparentProperties().filter(prop => !isPrivateIdentifierPropertyDeclaration(prop.valueDeclaration)),
symbols: type.getApparentProperties().filter(prop =>
!isPrivateIdentifierPropertyDeclaration(
isTransientSymbol(prop) && prop.syntheticOrigin ? prop.syntheticOrigin.valueDeclaration : prop.valueDeclaration)),
hasIndexSignature: hasIndexSignature(type)
};
}