// Code generated by convertFourslash; DO NOT EDIT. // To modify this test, run "npm run makemanual completionsForStringDependingOnContexSensitiveSignature" package fourslash_test import ( "testing" "github.com/microsoft/typescript-go/internal/fourslash" . "github.com/microsoft/typescript-go/internal/fourslash/tests/util" "github.com/microsoft/typescript-go/internal/testutil" ) func TestCompletionsForStringDependingOnContexSensitiveSignature(t *testing.T) { fourslash.SkipIfFailing(t) t.Parallel() defer testutil.RecoverAndFail(t, "Panic on fourslash test") const content = `// @strict: true type ActorRef = { send: (ev: TEvent) => void } type Action = { (ctx: TContext): void } type Config = { entry: Action } declare function createMachine(config: Config): void type EventFrom = T extends ActorRef ? TEvent : never declare function sendTo< TContext, TActor extends ActorRef >( actor: ((ctx: TContext) => TActor), event: EventFrom ): Action createMachine<{ child: ActorRef<{ type: "EVENT" }>; }>({ entry: sendTo((ctx) => ctx.child, { type: /*1*/ }), }); createMachine<{ child: ActorRef<{ type: "EVENT" }>; }>({ entry: sendTo((ctx) => ctx.child, { type: "/*2*/" }), });` f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content) defer done() f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{ IsIncomplete: false, ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ CommitCharacters: &DefaultCommitCharacters, EditRange: Ignored, }, Items: &fourslash.CompletionsExpectedItems{ Includes: []fourslash.CompletionsExpectedItem{ "\"EVENT\"", }, }, }) f.VerifyCompletions(t, "2", &fourslash.CompletionsExpectedList{ IsIncomplete: false, ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{ CommitCharacters: &DefaultCommitCharacters, EditRange: Ignored, }, Items: &fourslash.CompletionsExpectedItems{ Exact: []fourslash.CompletionsExpectedItem{ "EVENT", }, }, }) }