Microsoft/TypeScript

Inlay hints look awkward for callback parameters with a single parameter

Open

#45,389 opened on 2021年8月10日

GitHub で見る
 (4 comments) (5 reactions) (0 assignees)TypeScript (6,726 forks)batch import
Domain: LS: Inlay HintsExperience EnhancementFix AvailableHelp WantedRescheduledSuggestion

Repository metrics

Stars
 (48,455 stars)
PR merge metrics
 (平均マージ 6d 17h) (30d で 9 merged PRs)

説明

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

コントリビューターガイド