mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
fix(37364): show completions for string literal index on mapped type (#37367)
This commit is contained in:
parent
52dc9f2282
commit
aa6be6ee6f
@ -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)
|
||||
};
|
||||
}
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////type Foo = {
|
||||
//// a: string;
|
||||
//// b: string;
|
||||
////};
|
||||
////
|
||||
////type A = Readonly<Foo>;
|
||||
////type B = A["[|/**/|]"]
|
||||
|
||||
const replacementSpan = test.ranges()[0];
|
||||
verify.completions({
|
||||
marker: "",
|
||||
exact: [
|
||||
{ name: "a", replacementSpan },
|
||||
{ name: "b", replacementSpan }
|
||||
]
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user