Microsoft/TypeScript

Intellisense stops working inside nested `Array.map`

Open

#51.823 aberto em 8 de dez. de 2022

Ver no GitHub
 (0 comments) (2 reactions) (0 assignees)TypeScript (6.726 forks)batch import
Domain: LS: Completion ListsExperience EnhancementHelp WantedSuggestion

Métricas do repositório

Stars
 (48.455 stars)
Métricas de merge de PR
 (Mesclagem média 6d 17h) (9 fundiu PRs em 30d)

Description

Bug Report

🔎 Search Terms

Intellisense stops working inside Array.map

🕗 Version & Regression Information

  • Version 4.9.3

⏯ Playground Link

Playground link with relevant code

💻 Code

type Children = {
    name: string;
};

type Parent = {
    children: Children[];
};

let parents: Parent[] = [].map(() => ({ children: [].map(() => ({ /* Missing `name` property in intellisense */ })) }))

🙁 Actual behavior

Missing name property in intellisense image

🙂 Expected behavior

Have name property in intellisense

Note

I know I can put map<Children> to show intellisense, but using complex types like prisma, and with a lot of nested array, it wouldn't be very convenient to keep putting map<Type> (even worse if the type is in another file needs to be imported)

Guia do colaborador