Microsoft/TypeScript

Inlay hints look awkward for callback parameters with a single parameter

開放

#45,389 建立於 2021年8月10日

 (4 則留言) (5 個反應) (0 位負責人)TypeScript (13,395 個分叉)batch import
Domain: LS: Inlay HintsExperience EnhancementHelp WantedRescheduledSuggestion

倉庫指標

星標
 (108,860 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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

貢獻者指南