fix(46563): show completions at this type (#46581)

This commit is contained in:
Oleksandr T authored and GitHub committed 2021-12-03 14:29:45 -08:00
1 parent c5d9200ec6
commit 407edc95c0
9 files changed
+45 -5

No files matched your search

+1 -4
View File
@@ -432,6 +432,7 @@ namespace ts {
getIndexInfosOfType,
getSignaturesOfType,
getIndexTypeOfType: (type, kind) => getIndexTypeOfType(type, kind === IndexKind.String ? stringType : numberType),
getIndexType: type => getIndexType(type),
getBaseTypes,
getBaseTypeOfLiteralType,
getWidenedType,
@@ -15344,10 +15345,6 @@ namespace ts {
(type.flags & (TypeFlags.InstantiableNonPrimitive | TypeFlags.Index | TypeFlags.TemplateLiteral | TypeFlags.StringMapping) && !isPatternLiteralType(type) ? ObjectFlags.IsGenericIndexType : 0);
}
function isThisTypeParameter(type: Type): boolean {
return !!(type.flags & TypeFlags.TypeParameter && (type as TypeParameter).isThisType);
}
function getSimplifiedType(type: Type, writing: boolean): Type {
return type.flags & TypeFlags.IndexedAccess ? getSimplifiedIndexedAccessType(type as IndexedAccessType, writing) :
type.flags & TypeFlags.Conditional ? getSimplifiedConditionalType(type as ConditionalType, writing) :
+1
View File
@@ -4162,6 +4162,7 @@ namespace ts {
getIndexInfosOfType(type: Type): readonly IndexInfo[];
getSignaturesOfType(type: Type, kind: SignatureKind): readonly Signature[];
getIndexTypeOfType(type: Type, kind: IndexKind): Type | undefined;
/* @internal */ getIndexType(type: Type): Type;
getBaseTypes(type: InterfaceType): BaseType[];
getBaseTypeOfLiteralType(type: Type): Type;
getWidenedType(type: Type): Type;
+4
View File
@@ -7414,4 +7414,8 @@ namespace ts {
export function escapeSnippetText(text: string): string {
return text.replace(/\$/gm, "\\$");
}
export function isThisTypeParameter(type: Type): boolean {
return !!(type.flags & TypeFlags.TypeParameter && (type as TypeParameter).isThisType);
}
}