microsoft / microsoft/TypeScript

No completions for type parameters in generic function return type

Open
#59,419 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Help Wanted Suggestion
Dominant language
Go
Stars
111k
Forks
14.4k
Avg merge
1d 19h
Merged PRs (30d)
117

Description

I feel like we must have an issue for this one, but I can't find it.

function invertKeysAndValues<K, V>(map: Map<K, V>): Map</**/

Request completions at /**/

Expected: The type parameter V is provided as a valid completion entry.
Actual: VBArray is the first provided completion entry. This means that a commit character like , after typing in V will commit VBArray as a type argument.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the completion request in the generic function return type shown in the issue. Trace the completion behavior for the type parameter V and verify that V is offered before VBArray and that typing a comma after V does not commit VBArray.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.