Microsoft/TypeScript
在 GitHub 查看Inlay hints look awkward for callback parameters with a single parameter
Open
#45,389 建立於 2021年8月10日
Domain: LS: Inlay HintsExperience EnhancementFix AvailableHelp WantedRescheduledSuggestion
倉庫指標
- Star
- (48,455 star)
- PR 合併指標
- (平均合併 6天 17小時) (30 天內合併 9 個 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:

Ideally, you'd see that line rewritten as
callbackfn: (hint: InlayHint) => ({
```