Microsoft/TypeScript

Inlay hints look awkward for callback parameters with a single parameter

Open

#45 389 ouverte le 10 août 2021

Voir sur GitHub
 (4 commentaires) (5 réactions) (0 assignés)TypeScript (6 726 forks)batch import
Domain: LS: Inlay HintsExperience EnhancementFix AvailableHelp WantedRescheduledSuggestion

Métriques du dépôt

Stars
 (48 455 stars)
Métriques de merge PR
 (Merge moyen 6j 17h) (9 PRs mergées en 30 j)

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) => ({
```

Guide contributeur