diff --git a/src/lib/es2015.generator.d.ts b/src/lib/es2015.generator.d.ts index 064260fc47023..ac2d833b8d123 100644 --- a/src/lib/es2015.generator.d.ts +++ b/src/lib/es2015.generator.d.ts @@ -2,7 +2,7 @@ interface Generator extends Iterator { // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. - next(...args: [] | [TNext]): IteratorResult; + next(...[value]: [] | [TNext]): IteratorResult; return(value: TReturn): IteratorResult; throw(e: any): IteratorResult; [Symbol.iterator](): Generator; diff --git a/src/lib/es2015.iterable.d.ts b/src/lib/es2015.iterable.d.ts index 9ea54b67f7c45..98cf906c7db7c 100644 --- a/src/lib/es2015.iterable.d.ts +++ b/src/lib/es2015.iterable.d.ts @@ -22,7 +22,7 @@ type IteratorResult = IteratorYieldResult | IteratorReturnR interface Iterator { // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. - next(...args: [] | [TNext]): IteratorResult; + next(...[value]: [] | [TNext]): IteratorResult; return?(value?: TReturn): IteratorResult; throw?(e?: any): IteratorResult; } diff --git a/src/lib/es2018.asyncgenerator.d.ts b/src/lib/es2018.asyncgenerator.d.ts index 8ce3ba23a4d47..15385ddabfcb0 100644 --- a/src/lib/es2018.asyncgenerator.d.ts +++ b/src/lib/es2018.asyncgenerator.d.ts @@ -2,7 +2,7 @@ interface AsyncGenerator extends AsyncIterator { // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. - next(...args: [] | [TNext]): Promise>; + next(...[value]: [] | [TNext]): Promise>; return(value: TReturn | PromiseLike): Promise>; throw(e: any): Promise>; [Symbol.asyncIterator](): AsyncGenerator; diff --git a/src/lib/es2018.asynciterable.d.ts b/src/lib/es2018.asynciterable.d.ts index 5b868867f430d..4303763db533b 100644 --- a/src/lib/es2018.asynciterable.d.ts +++ b/src/lib/es2018.asynciterable.d.ts @@ -11,7 +11,7 @@ interface SymbolConstructor { interface AsyncIterator { // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. - next(...args: [] | [TNext]): Promise>; + next(...[value]: [] | [TNext]): Promise>; return?(value?: TReturn | PromiseLike): Promise>; throw?(e?: any): Promise>; } diff --git a/tests/baselines/reference/dependentDestructuredVariables.types b/tests/baselines/reference/dependentDestructuredVariables.types index 287dfb004259e..290bb2d397328 100644 --- a/tests/baselines/reference/dependentDestructuredVariables.types +++ b/tests/baselines/reference/dependentDestructuredVariables.types @@ -799,12 +799,12 @@ const { value, done } = it.next(); > : ^^^^^^^^^^^^^^^^^^^ >it.next() : IteratorResult > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->it.next : (...args: [] | [any]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>it.next : (...[value]: [] | [any]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >it : Iterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^ ->next : (...args: [] | [any]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>next : (...[value]: [] | [any]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ if (!done) { >!done : boolean diff --git a/tests/baselines/reference/destructuringAssignmentWithDefault2.types b/tests/baselines/reference/destructuringAssignmentWithDefault2.types index b3a2c81120575..0a4357ab349cf 100644 --- a/tests/baselines/reference/destructuringAssignmentWithDefault2.types +++ b/tests/baselines/reference/destructuringAssignmentWithDefault2.types @@ -173,12 +173,12 @@ let value; > : ^^^ >r.next() : IteratorResult > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->r.next : (...args: [] | [any]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>r.next : (...[value]: [] | [any]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >r : Iterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^ ->next : (...args: [] | [any]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>next : (...[value]: [] | [any]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ({ done: done = false, value } = r.next()); >({ done: done = false, value } = r.next()) : IteratorResult @@ -199,10 +199,10 @@ let value; > : ^^^ >r.next() : IteratorResult > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->r.next : (...args: [] | [any]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>r.next : (...[value]: [] | [any]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >r : Iterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^ ->next : (...args: [] | [any]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>next : (...[value]: [] | [any]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/discriminateWithOptionalProperty2(exactoptionalpropertytypes=false).types b/tests/baselines/reference/discriminateWithOptionalProperty2(exactoptionalpropertytypes=false).types index c378f82199043..ef7c8c5ae73d8 100644 --- a/tests/baselines/reference/discriminateWithOptionalProperty2(exactoptionalpropertytypes=false).types +++ b/tests/baselines/reference/discriminateWithOptionalProperty2(exactoptionalpropertytypes=false).types @@ -141,12 +141,12 @@ function mapAsyncIterable( > : ^^^^^^^^^^^^^^^^^^^^ >iterator.next() : Promise> > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->iterator.next : (...args: [] | [undefined]) => Promise> -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>iterator.next : (...[value]: [] | [undefined]) => Promise> +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >iterator : AsyncIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->next : (...args: [] | [undefined]) => Promise> -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>next : (...[value]: [] | [undefined]) => Promise> +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ }, async return(): Promise> { diff --git a/tests/baselines/reference/discriminateWithOptionalProperty2(exactoptionalpropertytypes=true).types b/tests/baselines/reference/discriminateWithOptionalProperty2(exactoptionalpropertytypes=true).types index c378f82199043..ef7c8c5ae73d8 100644 --- a/tests/baselines/reference/discriminateWithOptionalProperty2(exactoptionalpropertytypes=true).types +++ b/tests/baselines/reference/discriminateWithOptionalProperty2(exactoptionalpropertytypes=true).types @@ -141,12 +141,12 @@ function mapAsyncIterable( > : ^^^^^^^^^^^^^^^^^^^^ >iterator.next() : Promise> > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->iterator.next : (...args: [] | [undefined]) => Promise> -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>iterator.next : (...[value]: [] | [undefined]) => Promise> +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >iterator : AsyncIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->next : (...args: [] | [undefined]) => Promise> -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>next : (...[value]: [] | [undefined]) => Promise> +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ }, async return(): Promise> { diff --git a/tests/baselines/reference/iterableTReturnTNext(strictbuiltiniteratorreturn=false).types b/tests/baselines/reference/iterableTReturnTNext(strictbuiltiniteratorreturn=false).types index 11831b7d4eb31..be54143d328ee 100644 --- a/tests/baselines/reference/iterableTReturnTNext(strictbuiltiniteratorreturn=false).types +++ b/tests/baselines/reference/iterableTReturnTNext(strictbuiltiniteratorreturn=false).types @@ -18,8 +18,8 @@ const r1: number = map.values().next().value; // error when strictBuiltinIterato >map.values().next().value : any >map.values().next() : IteratorResult > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->map.values().next : (...args: [] | [any]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>map.values().next : (...[value]: [] | [any]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >map.values() : IterableIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^ >map.values : () => IterableIterator @@ -28,8 +28,8 @@ const r1: number = map.values().next().value; // error when strictBuiltinIterato > : ^^^^^^^^^^^^^^^^^^^ >values : () => IterableIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->next : (...args: [] | [any]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>next : (...[value]: [] | [any]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >value : any > : ^^^ @@ -48,8 +48,8 @@ const r2: Next = map.values().next(); // error when strictBuiltinIterato > : ^^^^^^^^^^^^ >map.values().next() : IteratorResult > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->map.values().next : (...args: [] | [any]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>map.values().next : (...[value]: [] | [any]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >map.values() : IterableIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^ >map.values : () => IterableIterator @@ -58,8 +58,8 @@ const r2: Next = map.values().next(); // error when strictBuiltinIterato > : ^^^^^^^^^^^^^^^^^^^ >values : () => IterableIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->next : (...args: [] | [any]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>next : (...[value]: [] | [any]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // based on: https://github.com/graphql/graphql-js/blob/e15c3ec4dc21d9fd1df34fe9798cadf3bf02c6ea/src/execution/__tests__/mapAsyncIterable-test.ts#L175 async function* source() { yield 1; yield 2; yield 3; } @@ -100,8 +100,8 @@ const r3: number | undefined = set.values().next().value; >set.values().next().value : any >set.values().next() : IteratorResult > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->set.values().next : (...args: [] | [any]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>set.values().next : (...[value]: [] | [any]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >set.values() : IterableIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^ >set.values : () => IterableIterator @@ -110,8 +110,8 @@ const r3: number | undefined = set.values().next().value; > : ^^^^^^^^^^^ >values : () => IterableIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->next : (...args: [] | [any]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>next : (...[value]: [] | [any]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >value : any > : ^^^ diff --git a/tests/baselines/reference/iterableTReturnTNext(strictbuiltiniteratorreturn=true).types b/tests/baselines/reference/iterableTReturnTNext(strictbuiltiniteratorreturn=true).types index 2f8827d04e15f..a3a82d1ba855c 100644 --- a/tests/baselines/reference/iterableTReturnTNext(strictbuiltiniteratorreturn=true).types +++ b/tests/baselines/reference/iterableTReturnTNext(strictbuiltiniteratorreturn=true).types @@ -19,8 +19,8 @@ const r1: number = map.values().next().value; // error when strictBuiltinIterato > : ^^^^^^^^^^^^^^^^^^ >map.values().next() : IteratorResult > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->map.values().next : (...args: [] | [any]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>map.values().next : (...[value]: [] | [any]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >map.values() : IterableIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >map.values : () => IterableIterator @@ -29,8 +29,8 @@ const r1: number = map.values().next().value; // error when strictBuiltinIterato > : ^^^^^^^^^^^^^^^^^^^ >values : () => IterableIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->next : (...args: [] | [any]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>next : (...[value]: [] | [any]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >value : number | undefined > : ^^^^^^^^^^^^^^^^^^ @@ -49,8 +49,8 @@ const r2: Next = map.values().next(); // error when strictBuiltinIterato > : ^^^^^^^^^^^^ >map.values().next() : IteratorResult > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->map.values().next : (...args: [] | [any]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>map.values().next : (...[value]: [] | [any]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >map.values() : IterableIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >map.values : () => IterableIterator @@ -59,8 +59,8 @@ const r2: Next = map.values().next(); // error when strictBuiltinIterato > : ^^^^^^^^^^^^^^^^^^^ >values : () => IterableIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->next : (...args: [] | [any]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>next : (...[value]: [] | [any]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // based on: https://github.com/graphql/graphql-js/blob/e15c3ec4dc21d9fd1df34fe9798cadf3bf02c6ea/src/execution/__tests__/mapAsyncIterable-test.ts#L175 async function* source() { yield 1; yield 2; yield 3; } @@ -105,8 +105,8 @@ const r3: number | undefined = set.values().next().value; > : ^^^^^^^^^^^^^^^^^^ >set.values().next() : IteratorResult > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->set.values().next : (...args: [] | [any]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>set.values().next : (...[value]: [] | [any]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >set.values() : IterableIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >set.values : () => IterableIterator @@ -115,8 +115,8 @@ const r3: number | undefined = set.values().next().value; > : ^^^^^^^^^^^ >values : () => IterableIterator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->next : (...args: [] | [any]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>next : (...[value]: [] | [any]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >value : number | undefined > : ^^^^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/privateNameMethodAsync.types b/tests/baselines/reference/privateNameMethodAsync.types index 5f7f74f19b003..eb8dd6cc759e6 100644 --- a/tests/baselines/reference/privateNameMethodAsync.types +++ b/tests/baselines/reference/privateNameMethodAsync.types @@ -54,16 +54,16 @@ const C = class { > : ^^^^^^^^^^^^^ >this.#baz().next() : IteratorResult > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->this.#baz().next : (...args: [] | [unknown]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>this.#baz().next : (...[value]: [] | [unknown]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this.#baz() : Generator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this.#baz : () => Generator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ ->next : (...args: [] | [unknown]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>next : (...[value]: [] | [unknown]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >value : number | void > : ^^^^^^^^^^^^^ >0 : 0 @@ -80,16 +80,16 @@ const C = class { > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this.#qux().next() : Promise> > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->this.#qux().next : (...args: [] | [unknown]) => Promise> -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>this.#qux().next : (...[value]: [] | [unknown]) => Promise> +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this.#qux() : AsyncGenerator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this.#qux : () => AsyncGenerator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this : this > : ^^^^ ->next : (...args: [] | [unknown]) => Promise> -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>next : (...[value]: [] | [unknown]) => Promise> +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >value : number | void > : ^^^^^^^^^^^^^ >0 : 0 diff --git a/tests/baselines/reference/privateNameStaticMethodAsync.types b/tests/baselines/reference/privateNameStaticMethodAsync.types index ddb582f217407..4f83aba289a32 100644 --- a/tests/baselines/reference/privateNameStaticMethodAsync.types +++ b/tests/baselines/reference/privateNameStaticMethodAsync.types @@ -54,16 +54,16 @@ const C = class { > : ^^^^^^^^^^^^^ >this.#baz().next() : IteratorResult > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->this.#baz().next : (...args: [] | [unknown]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>this.#baz().next : (...[value]: [] | [unknown]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this.#baz() : Generator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this.#baz : () => Generator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this : typeof C > : ^^^^^^^^ ->next : (...args: [] | [unknown]) => IteratorResult -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>next : (...[value]: [] | [unknown]) => IteratorResult +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >value : number | void > : ^^^^^^^^^^^^^ >0 : 0 @@ -80,16 +80,16 @@ const C = class { > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this.#qux().next() : Promise> > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->this.#qux().next : (...args: [] | [unknown]) => Promise> -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>this.#qux().next : (...[value]: [] | [unknown]) => Promise> +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this.#qux() : AsyncGenerator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this.#qux : () => AsyncGenerator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >this : typeof C > : ^^^^^^^^ ->next : (...args: [] | [unknown]) => Promise> -> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>next : (...[value]: [] | [unknown]) => Promise> +> : ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >value : number | void > : ^^^^^^^^^^^^^ >0 : 0 diff --git a/tests/baselines/reference/signatureHelpIteratorNext.baseline b/tests/baselines/reference/signatureHelpIteratorNext.baseline new file mode 100644 index 0000000000000..d3e83c2359672 --- /dev/null +++ b/tests/baselines/reference/signatureHelpIteratorNext.baseline @@ -0,0 +1,1584 @@ +// === SignatureHelp === +=== /tests/cases/fourslash/signatureHelpIteratorNext.ts === +// declare const iterator: Iterator; +// +// iterator.next(); +// ^ +// | ---------------------------------------------------------------------- +// | next(): IteratorResult +// | ---------------------------------------------------------------------- +// iterator.next( 0); +// ^ +// | ---------------------------------------------------------------------- +// | next(**value: number**): IteratorResult +// | ---------------------------------------------------------------------- +// +// declare const generator: Generator; +// +// generator.next(); +// ^ +// | ---------------------------------------------------------------------- +// | next(): IteratorResult +// | ---------------------------------------------------------------------- +// generator.next( 0); +// ^ +// | ---------------------------------------------------------------------- +// | next(**value: number**): IteratorResult +// | ---------------------------------------------------------------------- +// +// declare const asyncIterator: AsyncIterator; +// +// asyncIterator.next(); +// ^ +// | ---------------------------------------------------------------------- +// | next(): Promise> +// | ---------------------------------------------------------------------- +// asyncIterator.next( 0); +// ^ +// | ---------------------------------------------------------------------- +// | next(**value: number**): Promise> +// | ---------------------------------------------------------------------- +// +// declare const asyncGenerator: AsyncGenerator; +// +// asyncGenerator.next(); +// ^ +// | ---------------------------------------------------------------------- +// | next(): Promise> +// | ---------------------------------------------------------------------- +// asyncGenerator.next( 0); +// ^ +// | ---------------------------------------------------------------------- +// | next(**value: number**): Promise> +// | ---------------------------------------------------------------------- + +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/signatureHelpIteratorNext.ts", + "position": 71, + "name": "1" + }, + "item": { + "items": [ + { + "isVariadic": false, + "prefixDisplayParts": [ + { + "text": "next", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + } + ], + "suffixDisplayParts": [ + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "IteratorResult", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "separatorDisplayParts": [ + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + } + ], + "parameters": [], + "documentation": [], + "tags": [] + }, + { + "isVariadic": false, + "prefixDisplayParts": [ + { + "text": "next", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + } + ], + "suffixDisplayParts": [ + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "IteratorResult", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "separatorDisplayParts": [ + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + } + ], + "parameters": [ + { + "name": "value", + "documentation": [], + "displayParts": [ + { + "text": "value", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "isOptional": false, + "isRest": false + } + ], + "documentation": [], + "tags": [] + } + ], + "applicableSpan": { + "start": 71, + "length": 0 + }, + "selectedItemIndex": 0, + "argumentIndex": 0, + "argumentCount": 0 + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/signatureHelpIteratorNext.ts", + "position": 88, + "name": "2" + }, + "item": { + "items": [ + { + "isVariadic": false, + "prefixDisplayParts": [ + { + "text": "next", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + } + ], + "suffixDisplayParts": [ + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "IteratorResult", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "separatorDisplayParts": [ + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + } + ], + "parameters": [], + "documentation": [], + "tags": [] + }, + { + "isVariadic": false, + "prefixDisplayParts": [ + { + "text": "next", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + } + ], + "suffixDisplayParts": [ + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "IteratorResult", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "separatorDisplayParts": [ + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + } + ], + "parameters": [ + { + "name": "value", + "documentation": [], + "displayParts": [ + { + "text": "value", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "isOptional": false, + "isRest": false + } + ], + "documentation": [], + "tags": [] + } + ], + "applicableSpan": { + "start": 88, + "length": 2 + }, + "selectedItemIndex": 1, + "argumentIndex": 0, + "argumentCount": 1 + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/signatureHelpIteratorNext.ts", + "position": 168, + "name": "3" + }, + "item": { + "items": [ + { + "isVariadic": false, + "prefixDisplayParts": [ + { + "text": "next", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + } + ], + "suffixDisplayParts": [ + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "IteratorResult", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "separatorDisplayParts": [ + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + } + ], + "parameters": [], + "documentation": [], + "tags": [] + }, + { + "isVariadic": false, + "prefixDisplayParts": [ + { + "text": "next", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + } + ], + "suffixDisplayParts": [ + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "IteratorResult", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "separatorDisplayParts": [ + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + } + ], + "parameters": [ + { + "name": "value", + "documentation": [], + "displayParts": [ + { + "text": "value", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "isOptional": false, + "isRest": false + } + ], + "documentation": [], + "tags": [] + } + ], + "applicableSpan": { + "start": 168, + "length": 0 + }, + "selectedItemIndex": 0, + "argumentIndex": 0, + "argumentCount": 0 + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/signatureHelpIteratorNext.ts", + "position": 186, + "name": "4" + }, + "item": { + "items": [ + { + "isVariadic": false, + "prefixDisplayParts": [ + { + "text": "next", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + } + ], + "suffixDisplayParts": [ + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "IteratorResult", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "separatorDisplayParts": [ + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + } + ], + "parameters": [], + "documentation": [], + "tags": [] + }, + { + "isVariadic": false, + "prefixDisplayParts": [ + { + "text": "next", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + } + ], + "suffixDisplayParts": [ + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "IteratorResult", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "separatorDisplayParts": [ + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + } + ], + "parameters": [ + { + "name": "value", + "documentation": [], + "displayParts": [ + { + "text": "value", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "isOptional": false, + "isRest": false + } + ], + "documentation": [], + "tags": [] + } + ], + "applicableSpan": { + "start": 186, + "length": 2 + }, + "selectedItemIndex": 1, + "argumentIndex": 0, + "argumentCount": 1 + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/signatureHelpIteratorNext.ts", + "position": 278, + "name": "5" + }, + "item": { + "items": [ + { + "isVariadic": false, + "prefixDisplayParts": [ + { + "text": "next", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + } + ], + "suffixDisplayParts": [ + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Promise", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "IteratorResult", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "separatorDisplayParts": [ + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + } + ], + "parameters": [], + "documentation": [], + "tags": [] + }, + { + "isVariadic": false, + "prefixDisplayParts": [ + { + "text": "next", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + } + ], + "suffixDisplayParts": [ + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Promise", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "IteratorResult", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "separatorDisplayParts": [ + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + } + ], + "parameters": [ + { + "name": "value", + "documentation": [], + "displayParts": [ + { + "text": "value", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "isOptional": false, + "isRest": false + } + ], + "documentation": [], + "tags": [] + } + ], + "applicableSpan": { + "start": 278, + "length": 0 + }, + "selectedItemIndex": 0, + "argumentIndex": 0, + "argumentCount": 0 + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/signatureHelpIteratorNext.ts", + "position": 300, + "name": "6" + }, + "item": { + "items": [ + { + "isVariadic": false, + "prefixDisplayParts": [ + { + "text": "next", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + } + ], + "suffixDisplayParts": [ + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Promise", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "IteratorResult", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "separatorDisplayParts": [ + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + } + ], + "parameters": [], + "documentation": [], + "tags": [] + }, + { + "isVariadic": false, + "prefixDisplayParts": [ + { + "text": "next", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + } + ], + "suffixDisplayParts": [ + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Promise", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "IteratorResult", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "separatorDisplayParts": [ + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + } + ], + "parameters": [ + { + "name": "value", + "documentation": [], + "displayParts": [ + { + "text": "value", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "isOptional": false, + "isRest": false + } + ], + "documentation": [], + "tags": [] + } + ], + "applicableSpan": { + "start": 300, + "length": 2 + }, + "selectedItemIndex": 1, + "argumentIndex": 0, + "argumentCount": 1 + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/signatureHelpIteratorNext.ts", + "position": 395, + "name": "7" + }, + "item": { + "items": [ + { + "isVariadic": false, + "prefixDisplayParts": [ + { + "text": "next", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + } + ], + "suffixDisplayParts": [ + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Promise", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "IteratorResult", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "separatorDisplayParts": [ + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + } + ], + "parameters": [], + "documentation": [], + "tags": [] + }, + { + "isVariadic": false, + "prefixDisplayParts": [ + { + "text": "next", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + } + ], + "suffixDisplayParts": [ + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Promise", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "IteratorResult", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "separatorDisplayParts": [ + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + } + ], + "parameters": [ + { + "name": "value", + "documentation": [], + "displayParts": [ + { + "text": "value", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "isOptional": false, + "isRest": false + } + ], + "documentation": [], + "tags": [] + } + ], + "applicableSpan": { + "start": 395, + "length": 0 + }, + "selectedItemIndex": 0, + "argumentIndex": 0, + "argumentCount": 0 + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/signatureHelpIteratorNext.ts", + "position": 418, + "name": "8" + }, + "item": { + "items": [ + { + "isVariadic": false, + "prefixDisplayParts": [ + { + "text": "next", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + } + ], + "suffixDisplayParts": [ + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Promise", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "IteratorResult", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "separatorDisplayParts": [ + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + } + ], + "parameters": [], + "documentation": [], + "tags": [] + }, + { + "isVariadic": false, + "prefixDisplayParts": [ + { + "text": "next", + "kind": "methodName" + }, + { + "text": "(", + "kind": "punctuation" + } + ], + "suffixDisplayParts": [ + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Promise", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "IteratorResult", + "kind": "aliasName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "void", + "kind": "keyword" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ">", + "kind": "punctuation" + } + ], + "separatorDisplayParts": [ + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + } + ], + "parameters": [ + { + "name": "value", + "documentation": [], + "displayParts": [ + { + "text": "value", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "isOptional": false, + "isRest": false + } + ], + "documentation": [], + "tags": [] + } + ], + "applicableSpan": { + "start": 418, + "length": 2 + }, + "selectedItemIndex": 1, + "argumentIndex": 0, + "argumentCount": 1 + } + } +] \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpIteratorNext.ts b/tests/cases/fourslash/signatureHelpIteratorNext.ts new file mode 100644 index 0000000000000..72344e61a7fb3 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpIteratorNext.ts @@ -0,0 +1,24 @@ +/// +// @lib: esnext + +//// declare const iterator: Iterator; +//// +//// iterator.next(/*1*/); +//// iterator.next(/*2*/ 0); +//// +//// declare const generator: Generator; +//// +//// generator.next(/*3*/); +//// generator.next(/*4*/ 0); +//// +//// declare const asyncIterator: AsyncIterator; +//// +//// asyncIterator.next(/*5*/); +//// asyncIterator.next(/*6*/ 0); +//// +//// declare const asyncGenerator: AsyncGenerator; +//// +//// asyncGenerator.next(/*7*/); +//// asyncGenerator.next(/*8*/ 0); + +verify.baselineSignatureHelp();