Microsoft/TypeScript

Inlay hints look awkward for callback parameters with a single parameter

Aberta

#45.389 aberto em 10 de ago. de 2021

 (4 comentários) (5 reações) (0 responsável)TypeScript (13.395 forks)batch import
Domain: LS: Inlay HintsExperience EnhancementHelp WantedRescheduledSuggestion

Métricas do repositório

Stars
 (108.860 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

When you have a callback whose parameter has no parentheses, inlay hints starts to look a little bit weird.

For example, in this code

            return hints.map(hint => ({
                ...hint,
                position: scriptInfo.positionToLineOffset(hint.position),
            }));

you get the following:

image

Ideally, you'd see that line rewritten as

callbackfn: (hint: InlayHint) => ({
```

Guia do colaborador